@pratico/rx-extensions
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

@pratico/rx-extensions

This package provides some Rx.js extensions created to use in the @pratico projects

1. ObservableWatcher

Allows to follow a observable and known when it starts and when it concludes.

Example:

let observable: ObservableWatched = ObservableWatcher.watch<any>(Observable.of(1));

observable.watcher.onStarted.subscribe(() => {
  console.log('Called only when the user subscribes!!!');
});

observable.watcher.onCompleted.subscribe(() => {
  console.log('Called only when the observable finished by completion or error');
});


observable.subscribe((val) => {
  console.log('Processing...', observable.watcher.processing); // returns true while the the observable is running
  console.log('Value', val); // will print Value 1
});

Readme

Keywords

Package Sidebar

Install

npm i @pratico/rx-extensions

Weekly Downloads

3

Version

1.0.6

License

MIT

Last publish

Collaborators

  • abneroliveira