spion / promise-streams

A collection of node.js streams that work well with promises (through, map, reduce, etc...)
93 stars 11 forks source link

Expose _flush in promised manner #10

Open vanthome opened 8 years ago

vanthome commented 8 years ago

It would be nice to have this function exposed in the API in a promisified variant. That would allow for patterns like this:

somePromiseStream.wait().flush().then(...);

That means to wait until the stream's 'end' event has been emitted, then flush all remaining promises and return a promise for Promise.all() of them. What do you think?