nanoevents
Advanced tools
Comparing version 5.1.5 to 5.1.6
@@ -5,2 +5,5 @@ # Change Log | ||
## 5.1.5 | ||
* Clean up code. | ||
## 5.1.5 | ||
* Fix ES module regression. | ||
@@ -7,0 +10,0 @@ |
@@ -41,3 +41,3 @@ interface EventsMap { | ||
*/ | ||
on <K extends keyof Events>(this: this, event: K, cb: Events[K]): Unsubscribe | ||
on<K extends keyof Events> (this: this, event: K, cb: Events[K]): Unsubscribe | ||
@@ -54,3 +54,3 @@ /** | ||
*/ | ||
emit <K extends keyof Events>( | ||
emit<K extends keyof Events> ( | ||
this: this, | ||
@@ -57,0 +57,0 @@ event: K, |
let createNanoEvents = () => ({ | ||
events: { }, | ||
events: {}, | ||
emit (event, ...args) { | ||
@@ -9,6 +9,4 @@ for (let i of this.events[event] || []) { | ||
on (event, cb) { | ||
(this.events[event] = this.events[event] || []).push(cb) | ||
return () => ( | ||
this.events[event] = this.events[event].filter(i => i !== cb) | ||
) | ||
;(this.events[event] = this.events[event] || []).push(cb) | ||
return () => (this.events[event] = this.events[event].filter(i => i !== cb)) | ||
} | ||
@@ -15,0 +13,0 @@ }) |
{ | ||
"name": "nanoevents", | ||
"version": "5.1.5", | ||
"version": "5.1.6", | ||
"description": "Simple and tiny (72 bytes) event emitter library", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
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
9974
101