// FIXME: Deprecate this, it does not work as-expected when the onResult callback never gets called (eg. due to a stream immediately terminating), as the onResult callback will then never get a chance to set the lastResult, not even to an initializer value (eg. an empty array for `collect`)
// We return whatever value we got last from the specified onResult callback.
// We return whatever value we got last from the specified onResult callback.
returnlastResult;
returnlastResult;
})]
})]
@ -30,8 +32,10 @@ module.exports = function simpleSinkStream(_options) {
letonEndCalled=false;
letonEndCalled=false;
letonEndResult;
letonEndResult;
letabortHandled=false;
letabortHandled=false;
letlastKnownSource;
return{
return{
_promistreamVersion:0,
description:`simple sink stream`,
description:`simple sink stream`,
abort:propagateAbort,
abort:propagateAbort,
peek:propagatePeek,
peek:propagatePeek,
@ -50,9 +54,15 @@ module.exports = function simpleSinkStream(_options) {