1.0.0 • Published 4 years ago
rxjs-worker-subject v1.0.0
rxjs-worker-subject
rxjs-worker-subject
is an extension of the RxJS Subject,
a wrapper, which allows to work with Web Workers
using RxJS syntax.
Installation
npm install rxjs-worker-subject
Usage
worker.ts
addEventListener('message', ({ data }) => postMessage(data));
index.ts
const workerSubj = new WorkerSubject<string, string>(new Worker('./worker', { type: 'module' }));
workerSubj.subscribe(response => {
console.log(response);
});
workerSubj.next('ping');
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.