2.1.0 • Published 3 years ago

callbag-sample v2.1.0

Weekly downloads
64
License
MIT
Repository
github
Last release
3 years ago

callbag-sample

Callbag operator that samples a value from the pullable source only when a listenable source emits, and returns a listenable source.

npm install callbag-sample

example

Sample the next character from a string, every second:

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

const source = sample(fromIter('hello'))(interval(1000));

forEach(x => console.log(x))(source); // h
                                      // e
                                      // l
                                      // l
                                      // o
2.1.0

3 years ago

2.0.0

6 years ago

1.0.0

6 years ago