event-pubsub
Advanced tools
Comparing version 1.0.6 to 2.0.0
@@ -9,3 +9,3 @@ window.pubsub=( | ||
} | ||
checkScope.apply(this); | ||
@@ -20,2 +20,6 @@ | ||
function unsub(type,handler){ | ||
if(!handler){ | ||
var err=new ReferenceError('handler not defined. if you wish to remove all handlers from the event please pass "*" as the handler'); | ||
throw err; | ||
} | ||
checkScope.apply(this); | ||
@@ -40,3 +44,3 @@ | ||
if(!handler){ | ||
if(handler=='*'){ | ||
delete this._events_[type]; | ||
@@ -43,0 +47,0 @@ return; |
@@ -16,2 +16,6 @@ function sub(type,handler){ | ||
function unsub(type,handler){ | ||
if(!handler){ | ||
var err=new ReferenceError('handler not defined. if you wish to remove all handlers from the event please pass "*" as the handler'); | ||
throw err; | ||
} | ||
checkScope.apply(this); | ||
@@ -36,3 +40,3 @@ | ||
if(!handler){ | ||
if(handler=='*'){ | ||
delete this._events_[type]; | ||
@@ -39,0 +43,0 @@ return; |
{ | ||
"name": "event-pubsub", | ||
"version": "1.0.6", | ||
"version": "2.0.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", |
Event PubSub | ||
============ | ||
npm info : | ||
![event-pubsub npm version](https://img.shields.io/npm/v/event-pubsub.svg) ![total npm downloads for event-pubsub](https://img.shields.io/npm/dt/event-pubsub.svg) ![monthly npm downloads for event-pubsub](https://img.shields.io/npm/dm/event-pubsub.svg) | ||
![event-pubsub npm version](https://img.shields.io/npm/v/event-pubsub.svg) ![total npm downloads for event-pubsub](https://img.shields.io/npm/dt/event-pubsub.svg) ![monthly npm downloads for event-pubsub](https://img.shields.io/npm/dm/event-pubsub.svg) | ||
GitHub info : | ||
![event-pubsub GitHub Release](https://img.shields.io/github/release/RIAEvangelist/event-pubsub.svg) ![GitHub license event-pubsub license](https://img.shields.io/github/license/RIAEvangelist/event-pubsub.svg) ![open issues for event-pubsub on GitHub](https://img.shields.io/github/issues/RIAEvangelist/event-pubsub.svg) | ||
![event-pubsub GitHub Release](https://img.shields.io/github/release/RIAEvangelist/event-pubsub.svg) ![GitHub license event-pubsub license](https://img.shields.io/github/license/RIAEvangelist/event-pubsub.svg) ![open issues for event-pubsub on GitHub](https://img.shields.io/github/issues/RIAEvangelist/event-pubsub.svg) | ||
Pubsub events for Node and the browser allowing event scoping and multiple scopes. | ||
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! | ||
@@ -44,3 +44,3 @@ | ||
); | ||
events.on( | ||
@@ -52,11 +52,11 @@ '*', | ||
); | ||
events.on( | ||
'removeEvents', | ||
function(){ | ||
events.off('*'); | ||
events.off('*','*'); | ||
console.log('Removed all events'); | ||
} | ||
); | ||
/************************************\ | ||
@@ -73,4 +73,4 @@ * trigger events for testing | ||
); | ||
#### Browser | ||
@@ -101,3 +101,3 @@ ##### HTML | ||
); | ||
events.on( | ||
@@ -109,11 +109,11 @@ '*', | ||
); | ||
events.on( | ||
'removeEvents', | ||
function(){ | ||
events.off('*'); | ||
events.off('*','*'); | ||
console.log('Removed all events'); | ||
} | ||
); | ||
/************************************\ | ||
@@ -126,5 +126,5 @@ * trigger events for testing | ||
); | ||
events.trigger( | ||
'removeEvents' | ||
); |
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
26414
652