@kotorik/promise-worker
v0.1.0
Published
A modern version of nolanlawson/promise-worker, supports transferable objects
Downloads
14
Maintainers
Readme
@kotorik/promise-worker
Originated from https://github.com/nolanlawson/promise-worker
Similar Usage except:
- Service Worker is not supported.
Transferable supports
import registerPromiseWorker from "@kotorik/promise-worker/register";
registerPromiseWorker<string, Uint8Array>(async (msg, register) => {
const result = new TextEncoder().encode(msg);
register(result.buffer); // use this function to add things to transfer list
return result;
});