rxjs-worker-subject
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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

Package Sidebar

Install

npm i rxjs-worker-subject

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

5.01 kB

Total Files

9

Last publish

Collaborators

  • slavic.ronenko