Last active
August 29, 2015 14:05
-
-
Save wryk/c76d55763722edab5cc4 to your computer and use it in GitHub Desktop.
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
| import objectUrl from 'object-url' | |
| export default function scriptToWorker (script) { | |
| var blob = new Blob([script], {type: 'application/javascript'}) | |
| var url = objectUrl.create(blob) | |
| var worker = new Worker(url) | |
| objectUrl.revoke(url) | |
| return worker | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment