pull-composed
v1.0.4
Published
Take many pull stream pipelines and run them at once
Downloads
8
Readme
pull-composed
Take many pull stream pipelines (source, though and sinks) and run them at once.
Takes each argument and executes them if they happen to be a function, the merged arguments are also returned.
install
npm install pull-composed
usage
var compose = require('pull-composed')
var x = function () {
return pull(
pull.values([ 0, 1, 2, 3 ]),
pull.drain()
)
}
var y = function () {
return pull(
pull.values([ 4, 5, 6, 7 ]),
pull.drain()
)
}
var z = compose(
x,
x,
y,
y,
x,
x,
y
)
compose(x, z, x, y, z, compose(x), compose(x), z)
var x = compose(
x, y,
x, y
)
From a module
var pull = require('pull-stream');
var compose = require('pull-composed');
module.exports = function app () {
var x = function () {
return pull(
pull.values([ 'demo' ]),
pull.log()
)
}
return compose(x);
};