Skip to content

๐Ÿ‘œ Convert an iterable or iterator to a callbag pullable source

License

Notifications You must be signed in to change notification settings

avinashcodes/callbag-from-iter

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

callbag-from-iter

Convert a JS Iterable or Iterator to a callbag pullable source (it only sends data when requested).

npm install callbag-from-iterable

example

Convert an Iterable:

const fromIter = require('callbag-from-iterable');
const iterate = require('callbag-iterate');

const source = fromIter([10, 20, 30, 40]);

source(0, iterate(x => console.log(x)); // 10
                                        // 20
                                        // 30
                                        // 40

Convert an Iterator:

const fromIter = require('callbag-from-iterable');
const iterate = require('callbag-iterate');

const source = fromIter([10, 20, 30, 40].entries());

iterate(x => console.log(x))(source); // [0,10]
                                      // [1,20]
                                      // [2,30]
                                      // [3,40]

About

๐Ÿ‘œ Convert an iterable or iterator to a callbag pullable source

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • JavaScript 100.0%