Skip to content

Commit

Permalink
Re-emit close event too
Browse files Browse the repository at this point in the history
  • Loading branch information
Almad committed Feb 25, 2013
1 parent 6a8e5a1 commit cb707df
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

module.exports = function(obj){
var onData
, onEnd
Expand All @@ -14,10 +13,16 @@ module.exports = function(obj){
events.push(['end', data, encoding]);
});

// buffer close
obj.on('close', onClose = function(d){
events.push(['close']);
});

return {
end: function(){
obj.removeListener('data', onData);
obj.removeListener('end', onEnd);
obj.removeListener('close', onClose);
},
resume: function(){
this.end();
Expand All @@ -26,4 +31,4 @@ module.exports = function(obj){
}
}
};
};
};

0 comments on commit cb707df

Please sign in to comment.