I have a WebGL ES application that renders at 60 FPS and has expensive functions that take a few milliseconds.
Is it safe to use node:worker_threads
in the root App.js
file like so?
import {
Worker, isMainThread, parentPort, workerData,
} from node:worker_threads ;
export default function App() {
return <div>my app</div>;
}
if (!isMainThread) {
// Run expensive task here
}