0.1.0 • Published 7 years ago
iterate-fun v0.1.0
iterate-fun
A function toolbelt to work with iterables
background details relevant to understanding what this module does
Usage
description of the example
const iterateFun = require('iterate-fun');
console.log({iterateFun});
This will output
API
iterateFunction
Return an iterable that continously call fn
argument,
iterating over the results.
Parameters
fn
Function the function that returns result iterable items.
Examples
const arr = [42, 43, 44];
const result = iterateFunction(() => {
if (arr.length === 0) {
return Done;
}
return arr.shift() + 1;
});
// results === [43, 44, 45]
Returns any A new iterable that iterate over fn
results.
Install
With npm installed, run
$ npm install iterate-fun
See Also
License
MIT