sonic-boom
Advanced tools
Comparing version 1.0.2 to 1.1.0
@@ -22,2 +22,3 @@ 'use strict' | ||
sonic._writing = true | ||
sonic._asyncDrainScheduled = false | ||
sonic.file = file | ||
@@ -168,5 +169,13 @@ | ||
} | ||
this.on('newListener', function (name) { | ||
if (name === 'drain') { | ||
this._asyncDrainScheduled = false | ||
} | ||
}) | ||
} | ||
function emitDrain (sonic) { | ||
const hasListeners = sonic.listenerCount('drain') > 0 | ||
if (!hasListeners) return | ||
sonic._asyncDrainScheduled = false | ||
@@ -173,0 +182,0 @@ sonic.emit('drain') |
{ | ||
"name": "sonic-boom", | ||
"version": "1.0.2", | ||
"version": "1.1.0", | ||
"description": "Extremely fast utf8 only stream implementation", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -76,4 +76,2 @@ 'use strict' | ||
t.ok(stream.write('hello world\n')) | ||
stream.once('drain', () => { | ||
@@ -95,2 +93,4 @@ fs.readFile(dest, 'utf8', (err, data) => { | ||
t.ok(stream.write('hello world\n')) | ||
stream.on('finish', () => { | ||
@@ -97,0 +97,0 @@ t.pass('finish emitted') |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32686
1006