Closed rogierschouten closed 9 years ago
There are 2 reasons why forEach() doesn't return a promise:
Note that a Stream already has an ended()
method that you can use for this purpose.
In your example, you would:
var converterStream = snapshots.map(/* ... */);
converterStream.forEach(/* ... */);
return converterStream.ended(); // although snapshots.ended() might be more appropriate
What do you think?
I agree :)
Please return a promise from forEach() which resolves with the end() result. This allows to write: