Created
August 18, 2021 21:37
-
-
Save thomasdarimont/55c843d181c957ea2e5811822886bfb5 to your computer and use it in GitHub Desktop.
Inline WebWorker example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let code = `self.onmessage = msg => { console.log("Worker: %s", msg.data.text)}`; | |
const worker = new Worker("data:,"+code); | |
worker.postMessage({text: 'Hello from main thread!'}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment