Create a stream that emits events from multiple other streams
Merge (interleave) a bunch of streams.
var stream1 = ;var stream2 = ;var merged = mergeStreamstream1 stream2;var stream3 = ;mergedaddstream3;mergedisEmpty;//=> false
This is adapted from event-stream separated into a new module, using Streams3.
A method to dynamically add more sources to the stream.
A method that tells you if the merged stream is empty.
When a stream is "empty" (aka. no sources were added), it could not be returned to a gulp task.
So, we could do something like this:
stream = require'merge-stream';// Something like a loop to add some streams to the merge stream// stream.add(streamA);// stream.add(streamB);return streamisEmpty ? null : stream;