Skip to content
πŸ‘œ Convert an iterable or iterator to a callbag pullable source
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
.travis.yml
LICENSE
index.js
package.json
readme.md
test.js

readme.md

callbag-from-iter

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

npm install callbag-from-iter

example

Convert an Iterable:

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

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

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

Convert an Iterator:

const fromIter = require('callbag-from-iter');
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]
You can’t perform that action at this time.