Skip to content

๐Ÿ‘œ Callbag operator that samples a pullable when a listenable emits

License

Notifications You must be signed in to change notification settings

staltz/callbag-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

9 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

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

About

๐Ÿ‘œ Callbag operator that samples a pullable when a listenable emits

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •