This file contains hidden or 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
| function createWorker(fn) { | |
| // Create a Blob object that contains the code for the worker | |
| // create wrapper function that calls the function passed to createWorker | |
| // and then posts the result back to the main thread | |
| const fnStr = fn.toString() | |
| // wrap the function in a function that calls the function and posts the result | |
| const wrapper = `async function(evt) { | |
| const fn = ${fnStr} |
OlderNewer