@giuem/worker
v0.1.1
Published
Make WebWorker great again
Downloads
3
Readme
Worker (Experiment)
Make WebWorker great again.
Example
import { makeWorker } from '@giuem/worker';
function fibonacci(n) {
if(n==0 || n == 1) return n;
return fibonacci(n - 1) + fibonacci(n - 2);
}
const worker = makeWorker(fibonacci)
worker
.exec(20)
.then(console.log)
.finally(() => {
worker.terminate()
})