1.0.0 • Published 4 years ago

rxjs-worker-subject v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

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.

License

MIT

1.0.0

4 years ago

0.0.3

4 years ago

0.0.4

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago