You can perform tasks on only two threads.. 1 . The main UI thread .. 2 . Web Worker thread.
As you have already mentioned correctly , web worker thread doesn't have access to DOM , So at max what we can do is create an utility function that runs on main UI thread aysnc. and access & return dom manipulation results required.. from code running in Web workers.
In Short an utility to which we can send messages from WebWorker to access/modify/read perform DOM operations and sendback the response to web-worker.
Atul Sharma
Full Stack Developer | Cloud Native Applications
You can perform tasks on only two threads.. 1 . The main UI thread .. 2 . Web Worker thread.
As you have already mentioned correctly , web worker thread doesn't have access to DOM , So at max what we can do is create an utility function that runs on main UI thread aysnc. and access & return dom manipulation results required.. from code running in Web workers.
In Short an utility to which we can send messages from WebWorker to access/modify/read perform DOM operations and sendback the response to web-worker.