Skip to content
Browse files

pausable

  • Loading branch information...
1 parent a1e520d commit bc2447e8ddf280dacc3715e92a7fc4b35bb012f4 @dominictarr committed Feb 5, 2013
Showing with 4 additions and 6 deletions.
  1. +4 −6 index.js
View
10 index.js
@@ -29,18 +29,16 @@ function split (matcher, mapper) {
if(mapper) {
piece = mapper(piece)
if('undefined' !== typeof piece)
- stream.emit('data', piece)
+ stream.queue(piece)
}
else
- stream.emit('data', piece)
+ stream.queue(piece)
}
-
- return true
},
function () {
if(soFar)
- this.emit('data', soFar)
- this.emit('end')
+ this.queue(soFar)
+ this.queue(null)
})
}

0 comments on commit bc2447e

Please sign in to comment.
Something went wrong with that request. Please try again.