0.0.1 • Published 10 years ago
co-lazy v0.0.1
co-lazy
Lazily create a co stream when it's first read from.
Useful for when streams need setup and you for example map them over values
with co-cat
.
Example
var lazy = require('co-lazy');
var stream = lazy(function*(){
yield doSomeSetup();
return function*(end){
// .. the stream implementation
}
});
API
lazy(fn)
Lazily create a stream from fn
, returning a stream immediately.
Installation
$ npm install co-lazy
License
MIT