$ npm install pull-defer
create a placeholder for a pull stream that won't start moving until later.
pull-defer
can be used with source, sinks and transform streams.
//create a deferred through stream
var deferred = require('pull-defer').through()
pull(
input,
deferred,
output
)
//nothing will happen until deferred.resolve(stream) is called.
deferred.resolve(transform)
//create a deferred through stream
var deferred = require('pull-defer').source()
pull(
deferred,
output
)
//nothing will happen until deferred.resolve(stream) is called.
deferred.resolve(input)
//create a deferred through stream
var deferred = require('pull-defer').sink()
pull(
input,
deferred
)
//nothing will happen until deferred.start(stream) is called.
deferred.resolve(output)
MIT
© 2010 - cnpmjs.org x YWFE | Home | YWFE