Skip to content

Commit

Permalink
Fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmillr committed Apr 15, 2019
1 parent 5b5df14 commit fadc9c8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,10 @@ class ReaddirpStream extends Readable {

_emitPushIfUserWantsDir(entry) {
if (DIR_TYPES.has(this._entryType)) {
setImmediate(() => {this._push(entry)});
// TODO: Understand why this happens.
const fn = () => {this._push(entry)};
if (this._isDirent) setImmediate(fn);
else fn();
}
}

Expand Down

0 comments on commit fadc9c8

Please sign in to comment.