event-pubsub
Advanced tools
Comparing version 2.1.2 to 2.2.0
@@ -25,14 +25,5 @@ window.pubsub=( | ||
if(type=='*'){ | ||
var params=Array.prototype.slice.call(arguments,1); | ||
for( | ||
var keys = Object.keys(this._events_), | ||
count = keys.length, | ||
i=0; | ||
i<count; | ||
i++ | ||
){ | ||
params.unshift(keys[i]); | ||
this.off.apply(this,params); | ||
} | ||
if(handler=='*'){ | ||
delete this._events_[type]; | ||
return; | ||
} | ||
@@ -43,7 +34,2 @@ | ||
if(handler=='*'){ | ||
delete this._events_[type]; | ||
return; | ||
} | ||
for(var i=0, | ||
@@ -50,0 +36,0 @@ count=this._events_[type].length; |
@@ -22,14 +22,5 @@ function sub(type,handler){ | ||
if(type=='*'){ | ||
var params=Array.prototype.slice.call(arguments,1); | ||
for( | ||
var keys = Object.keys(this._events_), | ||
count = keys.length, | ||
i=0; | ||
i<count; | ||
i++ | ||
){ | ||
params.unshift(keys[i]); | ||
this.off.apply(this,params); | ||
} | ||
if(handler=='*'){ | ||
delete this._events_[type]; | ||
return; | ||
} | ||
@@ -40,7 +31,2 @@ | ||
if(handler=='*'){ | ||
delete this._events_[type]; | ||
return; | ||
} | ||
for(var i=0, | ||
@@ -47,0 +33,0 @@ count=this._events_[type].length; |
var events = new require('../../event-pubsub.js')(); | ||
/************************************\ | ||
* | ||
* | ||
* The events var was instantiated | ||
* as it's own scope | ||
* | ||
* | ||
* **********************************/ | ||
@@ -26,3 +26,3 @@ | ||
data:{ | ||
x:'YAY, Objects!' | ||
x:'YAY, Objects!' | ||
} | ||
@@ -38,3 +38,3 @@ } | ||
console.log('World event got',data); | ||
events.off('*'); | ||
events.off('*','*'); | ||
console.log('Removed all events'); | ||
@@ -45,7 +45,7 @@ } | ||
/**********************************\ | ||
* | ||
* | ||
* Demonstrate * event (on all events) | ||
* remove this for less verbose | ||
* example | ||
* | ||
* | ||
* ********************************/ | ||
@@ -65,2 +65,2 @@ events.on( | ||
'world' | ||
); | ||
); |
{ | ||
"name": "event-pubsub", | ||
"version": "2.1.2", | ||
"version": "2.2.0", | ||
"description": "Pubsub events for Node and the browser allowing event scoping and multiple scopes. Easy for any developer level. No frills, just high speed pubsub events!", | ||
@@ -5,0 +5,0 @@ "main": "event-pubsub.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
25608
627