kefir.handlebytype
A tiny helper to facilitate event replication over Kefir.Observable Flux-like event streams. Works best when paired with kefir.handle
.
Installation
NPM
npm install kefir.handlebytype
Usage
Each of handler is invoked with three arguments: an emitter, the value of the event (without the type
property), and an event object.
;;; var source = Kefir; source;
A second argument, options
, can be passed to further control the handler. A options value of { only: true }
will throw away types that are not matched by any handler.
source; // Only FOO events will be re-emitted.