rx-nats
TypeScript icon, indicating that this package has built-in type declarations

0.6.3 • Public • Published

RX-NATS

Use nats as rxjs observable.

Feel free to dig around a try this lib.

NatsSubject

This represents subject in nats. It implements Subscriber so you can do things like this

of(1,2,3).subscribe(natsSubject)

Class provides hot and cold observable. The difference is, that cold observable subscribes to nats on rxjs subscription and unsubscribes on error or complete. Hot observable need you to subscribe and unsubscribe manually on NatsSubject. Hot observable is good for robust error handling.

Example:

subject.hot.pipe(tap(handleRequest),retry()).subscribe()

this snippet is example, how to not get disconnected, when some error happen.

Readme

Keywords

none

Package Sidebar

Install

npm i rx-nats

Weekly Downloads

1

Version

0.6.3

License

ISC

Unpacked Size

102 kB

Total Files

18

Last publish

Collaborators

  • yeneek