rx-graceful
Makes RxJS Subjects graceful. Why? Because...
- Exceptions usually terminate Subjects and often swallow errors.
- It's naive to be confident our code does not contain an exception.
Installation
npm install rx-graceful
Example
'use strict' const Rx = Rx const $ = $ // (1) catches exceptions inside map // (2) catches rejections inside flatMap // (3) catches exceptions inside async functions (as these are rejections as well) $next'some value'
Future improvements
- Use lettable operators instead of mutating
Subject.prototype
, as soon as they're out of beta