developit / workerize

🏗️ Run a module in a Web Worker.
https://github.com/developit/workerize-loader
4.35k stars 91 forks source link

Pass worker as context, `this` not set inside arrow fn #28

Closed boblauer closed 6 years ago

boblauer commented 6 years ago

this is undefined because worker.terminate is an arrow function. Instead, we can just pass worker in explicitly.

boblauer commented 6 years ago

Any chance you could publish this to npm?