1.0.0 • Published 4 years ago
@gedalos.dev/callbag-join v1.0.0
callbag-join
Joins source data in arrays of specified size.
Only data is transmitted if the specified size has been reached, otherwise they are dismissed, (even if the stream ends).
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-join
using from nodejs
import pipe from '@gedalos.dev/callbag-pipe';
import of from '@gedalos.dev/callbag-of';
import join from '@gedalos.dev/callbag-join';
import forEach from '@gedalos.dev/callbag-for-each';
pipe(
of(1, 2, 3, 5, 8, 13, 21),
join(2),
forEach(console.log) // [1, 2], [3, 5], [8, 13]
);
using from browser
import pipe from 'callbag-pipe/index.js';
import of from 'callbag-of/index.js';
import join from 'callbag-join/index.js';
import forEach from 'callbag-for-each/index.js';
pipe(
of(1, 2, 3, 5, 8, 13, 21),
join(2),
forEach(console.log) // [1, 2], [3, 5], [8, 13]
);
1.0.0
4 years ago