simple-web-worker
simple-web-worker copied to clipboard
How to send a message from worker to main script?
I mean somting like this in main script
worker.addEventListener("message", e => {
console.log(e.data);
}, false);
I know the promise style return value, but this style only return 1 value at at time. if I want to receive a series of values, like post message by setInterval() in worker context. how can I receive the messages sent by worker ?