rxjs-toolkit is now unmaintained and has been left up as prior art for future inspiration. Note that there are some operators that do not work in IE11. 10/5/19

This is the beginning of rxjs-toolkit , a small utility library focused on reusability and everyday use, based on custom pipeable operators. There’s only a small handful available for now, and more will get added over time.

Install rxjs-toolkit via your favorite Node package manager:

npm i rxjs-toolkit

yarn add rxjs-toolkit

Here are a few of the operators to get you started:

tapLog

When it comes to debugging RxJS streams, often one of the best tools is to use the tap operator and log out the signal passing through. In rxjs-toolkit , there’s an operator for that called tapLog .

ignoreFalsySignals

Sometimes an unwanted null or undefined value could get pushed down your Observable stream. We can mitigate those signals with branching logic inside of a map or use a filter operator to only let truthy signals through. Here’s the ignoreFalsySignals operator for that situation:

Here’s a more plausible situation, when you have a stream setup from a function that is hitting an API:

In the example above we have guaranteed that the signal is not falsy, but we have not guaranteed the truthy existence of signal.foo . We can solve for that with propsAreTruthy .

propsAreTruthy

When an Object is traveling through a stream sometimes it won’t have a truthy value for a given property. We can use the propsAreTruthy operator to check if all top-level properties are truthy values. If they aren’t, the signal will be mapped to false :

Instead of the default of checking all top-level properties, specific properties and nested properties can be checked by passing a list of comma separated strings:

Composable: propsAreTruthy + ignoreFalsyValues

To make our lives a bit easier, we can use these two helpers together.

Check for the truthiness of an Object property

Ignore the signal if the Object property we care about is falsy

Keep the stream open for the next signal to pass through

Enjoy! More operators are on the way :)