Created
October 11, 2016 20:47
-
-
Save ericwooley/bd934f49db7c6185172a097e69061d88 to your computer and use it in GitHub Desktop.
Web worker from local function
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
function testFunction () { | |
console.log('webworker success') | |
} | |
var worker = new Worker(URL.createObjectURL(new Blob(['(' + testFunction.toString() + ')()'], {type: 'application/javascript'}))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment