es6lazy
v1.0.0
Published
Lazy, ES6, higher order, processing methods
Downloads
2
Readme
ES6 Lazy Higher Order Functions
Map and filter over generators.
Example:
'use strict';
function* myGenerator() {
for(let x = 0; x < 10; x++) {
yield x;
}
}
const filtered = lazy.filter(myGenerator(), function(x) {
return (x % 2) === 0;
});
const mapped = lazy.map(filtered, function(x) {
return x + 1;
});
console.log(lazy.iterToArray(mapped));
// [1, 3, 5, 7, 9]
API
TODO:
License
MIT (c) Samuel Giles 2014