1.0.1 • Published 4 years ago

@gedalos.dev/callbag-tap v1.0.1

Weekly downloads
4
License
ISC
Repository
gitlab
Last release
4 years ago

callbag-tap

Taps with the specified operation, (side effect, does not affect piped data).

original idea by André Staltz - callbag

run test

$ yarn

$ yarn -s test

the status code ($?) will be 0 or 1 depending on the result.

install

$ yarn add @gedalos.dev/callbag-tap

using from nodejs

import pipe from '@gedalos.dev/callbag-pipe';
import of from '@gedalos.dev/callbag-of';
import tap from '@gedalos.dev/callbag-tap';
import forEach from '@gedalos.dev/callbag-for-each';

pipe(
  of(1, 2, 3, 5, 8, 13, 21),
  tap((data) => data * 2),
  forEach(console.log) // 1, 2, 3, 5, 8, 13, 21
);

using from browser

import pipe from 'callbag-pipe/index.js';
import of from 'callbag-of/index.js';
import tap from 'callbag-tap/index.js';
import forEach from 'callbag-for-each/index.js';

pipe(
  of(1, 2, 3, 5, 8, 13, 21),
  tap((data) => data * 2),
  forEach(console.log) // 1, 2, 3, 5, 8, 13, 21
);
1.0.1

4 years ago

1.0.0

4 years ago