We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 555d88e commit 159ed2bCopy full SHA for 159ed2b
asynciterator.ts
@@ -2038,13 +2038,17 @@ export class WrappingIterator<T> extends AsyncIterator<T> {
2038
this._source._destination = this;
2039
this._source.on('end', destinationClose);
2040
this._source.on('error', destinationEmitError);
2041
- this._source.on('readable', () => this.emit('readable'));
2042
this._source.on('readable', destinationSetReadable);
2043
this.readable = true;
2044
}
2045
2046
read(): T | null {
2047
- return this._source ? this._source.read() : null;
+ let item = null;
+ if (this._source)
2048
+ item = this._source.read();
2049
+ if (!item)
2050
+ this.readable = false;
2051
+ return item;
2052
2053
2054
protected _end(destroy: boolean = false) {
0 commit comments