co-lazy

0.0.1 • Public • Published

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

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i co-lazy

      Weekly Downloads

      3

      Version

      0.0.1

      License

      MIT

      Last publish

      Collaborators

      • juliangruber