mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-04 09:28:11 +00:00
Co-authored-by: Michael Chung <michaelchung@Michaels-MacBook-Pro-2.local> Co-authored-by: Michael Chung <michaelchung@michaels-mbp-2.home>
13 lines
280 B
JavaScript
13 lines
280 B
JavaScript
onconnect = function (event) {
|
|
console.log('worker loaded');
|
|
|
|
const port = event.ports[0];
|
|
|
|
port.onmessage = function (e) {
|
|
console.log('worker message received');
|
|
const workerResult = `Result: ${e.data[0] * e.data[1]}`;
|
|
port.postMessage(workerResult);
|
|
};
|
|
};
|
|
|