Permalink
Browse files

Re-emit close event too

  • Loading branch information...
1 parent 6a8e5a1 commit cb707dfb330c20e93f1b5cef23c783d6b699a39f @Almad Almad committed Feb 25, 2013
Showing with 7 additions and 2 deletions.
  1. +7 −2 index.js
View
@@ -1,4 +1,3 @@
-
module.exports = function(obj){
var onData
, onEnd
@@ -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();
@@ -26,4 +31,4 @@ module.exports = function(obj){
}
}
};
-};
+};

0 comments on commit cb707df

Please sign in to comment.