Permalink
Browse files

properly emitting data events

  • Loading branch information...
1 parent c03ef91 commit efd1c02e8d0b97c485c148457084251b19011e21 @luk- committed Mar 2, 2013
Showing with 1 addition and 3 deletions.
  1. +1 −3 index.js
View
@@ -24,13 +24,11 @@ module.exports = function (data, html) {
if (!html) {
var stream = new Stream
stream.writable = stream.readable = true
- var htmlBuffer = ''
stream.write = function (buf) {
- htmlBuffer += buf.toString()
+ this.emit('data', plant(data, buf.toString()))
}
stream.end = function () {
stream.writable = false
- this.emit('data', plant(data, htmlBuffer))
}
return stream
}

0 comments on commit efd1c02

Please sign in to comment.