mirror of
https://github.com/denoland/deno.git
synced 2024-11-02 09:34:19 -04:00
12 lines
259 B
TypeScript
12 lines
259 B
TypeScript
|
// Tests basic postMessage, close, onmessage
|
||
|
const jsWorker = new Worker("./subdir/test_worker_basic.js", {
|
||
|
type: "module",
|
||
|
name: "jsWorker"
|
||
|
});
|
||
|
|
||
|
jsWorker.onmessage = (e): void => {
|
||
|
console.log("main recv: " + e.data);
|
||
|
};
|
||
|
|
||
|
jsWorker.postMessage("msg1");
|