Skip to content
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.

Commit

Permalink
Abstract out the emitChild method
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Mar 27, 2012
1 parent 34cdcea commit 6439e4c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/dir-reader.js
Expand Up @@ -144,8 +144,7 @@ DirReader.prototype._read = function () {
if (entry.type === "Socket") {
me.emit("socket", entry)
} else {
me.emit("entry", entry)
me.emit("child", entry)
me.emitEntry(entry)
}
})

Expand Down Expand Up @@ -235,3 +234,8 @@ DirReader.prototype.resume = function (who) {
}
} else me._read()
}

DirReader.prototype.emitEntry = function (entry) {
this.emit("entry", entry)
this.emit("child", entry)
}

0 comments on commit 6439e4c

Please sign in to comment.