callbag-sample-combine

1.1.0 • Public • Published

callbag-sample-combine

Callbag operator behaving exactly like callbag-sample by André Staltz except the return source emits both the original listenable and the sampled pullable values together.

npm install callbag-sample-combine

example

const sampleCombine = require('callbag-sample-combine');
const fromIter = require('callbag-from-iter');
const fromInterval = require('callbag-interval');
const forEach = require('callbag-for-each');
 
const listenable = fromInterval(1000);
const pullable = fromIter(['foo', 'bar', 'baz']);
 
const source = sampleCombine(pullable)(listenable);
const sink = forEach(d => console.log(d));
 
source(0, sink);   // [1, 'foo']
                   // [2, 'bar']
                   // [3, 'baz']

Dependencies (0)

    Dev Dependencies (4)

    Package Sidebar

    Install

    npm i callbag-sample-combine

    Weekly Downloads

    3

    Version

    1.1.0

    License

    MIT

    Unpacked Size

    6.29 kB

    Total Files

    6

    Last publish

    Collaborators

    • krawaller