Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

event-pubsub

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

event-pubsub - npm Package Compare versions

Comparing version 2.1.2 to 2.2.0

20

event-pubsub-browser.js

@@ -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;

14

examples/node/basic.js
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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc