Closed reverofevil closed 10 years ago
Make the condition a function that takes in the file and put the switch in your function.
According to README.md
, that function should return boolean
, not a stream. How is it supposed to combine outputs of child streams?
The second and optionally the third arguments are your streams. The boolean condition tells ternary-stream (ultimately fork-stream) which stream should receive each file. The results of your "if" and "else" streams are then combined back into an output stream using event-stream.merge. duplexer2 then combines the input and output streams into a single stream that users consume. See https://github.com/robrich/ternary-stream/blob/master/index.jsand https://github.com/robrich/ternary-stream/blob/master/img/ternary.svg
Maybe you can try this https://github.com/popomore/stream-switch
What if I would like a
switch
?