1.3.0 • Published 6 years ago

callbag-tap v1.3.0

Weekly downloads
208
License
MIT
Repository
github
Last release
6 years ago

callbag-tap

Callbag operator that taps the source with the given function, but otherwise acts as a noop.

Therefore it is not the same as forEach which is a sink (that actively consumes sources).

npm install callbag-tap

You can tap data, error and completion respectively:

const tapped = tap(dataTapFunc, errorTapFunc, completionTapFunc)(source);

example

const fromIter = require('callbag-from-iter');
const tap = require('callbag-tap');
const forEach = require('callbag-for-each');

const source = fromIter([1,2,3]);
const tapped = tap(x => console.log("tap", x))(source);
const sink = forEach(x => console.log("sink", x))(tapped);

// tap 1
// sink 1
// tap 2
// sink 2
// tap 3
// sink 3
1.3.0

6 years ago

1.1.0

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago