metal-events
Advanced tools
Comparing version 2.5.14 to 2.5.16
@@ -193,3 +193,3 @@ 'use strict'; | ||
value: function emit(event) { | ||
var listeners = toArray(this.getRawListeners_(event)).concat(); | ||
var listeners = this.getRawListeners_(event); | ||
if (listeners.length === 0) { | ||
@@ -207,3 +207,3 @@ return false; | ||
* @param {string} event | ||
* @return {Array} | ||
* @return {!Array} | ||
* @protected | ||
@@ -215,3 +215,4 @@ */ | ||
value: function getRawListeners_(event) { | ||
return this.events_ && this.events_[event]; | ||
var directListeners = toArray(this.events_ && this.events_[event]); | ||
return directListeners.concat(toArray(this.events_ && this.events_['*'])); | ||
} | ||
@@ -241,3 +242,3 @@ | ||
value: function listeners(event) { | ||
return toArray(this.getRawListeners_(event)).map(function (listener) { | ||
return this.getRawListeners_(event).map(function (listener) { | ||
return listener.fn ? listener.fn : listener; | ||
@@ -244,0 +245,0 @@ }); |
{ | ||
"name": "metal-events", | ||
"version": "2.5.14", | ||
"version": "2.5.16", | ||
"description": "Classes responsible for emitting and listening to events", | ||
@@ -5,0 +5,0 @@ "license": "BSD", |
@@ -141,3 +141,3 @@ 'use strict'; | ||
emit(event) { | ||
const listeners = toArray(this.getRawListeners_(event)).concat(); | ||
const listeners = this.getRawListeners_(event); | ||
if (listeners.length === 0) { | ||
@@ -155,7 +155,8 @@ return false; | ||
* @param {string} event | ||
* @return {Array} | ||
* @return {!Array} | ||
* @protected | ||
*/ | ||
getRawListeners_(event) { | ||
return this.events_ && this.events_[event]; | ||
const directListeners = toArray(this.events_ && this.events_[event]); | ||
return directListeners.concat(toArray(this.events_ && this.events_['*'])); | ||
} | ||
@@ -179,3 +180,3 @@ | ||
listeners(event) { | ||
return toArray(this.getRawListeners_(event)).map( | ||
return this.getRawListeners_(event).map( | ||
listener => listener.fn ? listener.fn : listener | ||
@@ -182,0 +183,0 @@ ); |
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
52467
1482