bare-events
Advanced tools
Comparing version 2.4.0 to 2.4.1
14
index.js
@@ -278,11 +278,11 @@ const errors = require('./lib/errors') | ||
if (name !== 'error') emitter.on('error', onerror) | ||
if (signal) signal.addEventListener('abort', onabort) | ||
if (name !== 'error') emitter.on('error', onerror) | ||
emitter.once(name, (...args) => { | ||
if (name !== 'error') emitter.off('error', onerror) | ||
emitter.once(name, (...args) => { | ||
if (signal) signal.removeEventListener('abort', onabort) | ||
if (name !== 'error') emitter.off('error', onerror) | ||
resolve(args) | ||
@@ -292,2 +292,4 @@ }) | ||
function onerror (err) { | ||
emitter.off('error', onerror) | ||
reject(err) | ||
@@ -297,3 +299,5 @@ } | ||
function onabort () { | ||
reject(errors.OPERATION_ABORTED(signal.reason)) | ||
signal.removeEventListener('abort', onabort) | ||
onerror(errors.OPERATION_ABORTED(signal.reason)) | ||
} | ||
@@ -300,0 +304,0 @@ }) |
{ | ||
"name": "bare-events", | ||
"version": "2.4.0", | ||
"version": "2.4.1", | ||
"description": "Event emitters for JavaScript", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
19831
263