The process is sent to the webworker according to the conditions in a loop as follows.
while () {
if (~~~) {
worker.postMessage({ action: "init", data: offscreenCanvas }, [offscreenCanvas]);
}
・・・
if (~~~) {
worker.postMessage({ action: "draw", data: offscreenCanvas }, [offscreenCanvas]);
}
}
But once the first message was sent, it didn't seem to be sent after that.
Can I only send it once?
I'm using worker-loader.