Created
April 7, 2018 09:06
-
-
Save jyotendra/f820de71e8441430ef694f2c8dbae13f to your computer and use it in GitHub Desktop.
Gist to demonstrate web workers
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
onmessage = function(e) { | |
console.log('Message received from main script'); | |
var workerResult = 'Result: ' + (e.data[0] * e.data[1]); | |
console.log('Posting message back to main script'); | |
postMessage(workerResult); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment