merge-stream
Merge (interleave) a bunch of streams.
Synopsis
Description
This is adapted from event-stream separated into a new module, using Streams3.
API
mergeStream
mergeStream
Type: function
Merges an arbitrary number of streams. Returns a merged stream.
merged.add
merged.add
A method to dynamically add more sources to the stream. The argument supplied to add
can be either a source or an array of sources.
merged.isEmpty
merged.isEmpty
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:
Gulp example
An example use case for merge-stream is to combine parts of a task in a project's gulpfile.js like this:
License
MIT
Last updated