developit/workerize-loader

Terminate / Destroy Web Worker

jantimon opened this issue · 1 comments

Is there any way to clean up a service worker?

From https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers#Terminating_a_worker

myWorker.terminate();

Found it:

const inst = worker();
inst.terminate();