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

component-emitter

Package Overview
Dependencies
Maintainers
31
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

component-emitter - npm Package Compare versions

Comparing version 1.1.3 to 1.2.0

11

History.md
1.2.0 / 2014-02-12
==================
* prefix events with `$` to support object prototype method names
1.1.3 / 2014-06-20
==================
* republish for npm
* add LICENSE file
1.1.2 / 2014-02-10

@@ -3,0 +14,0 @@ ==================

15

index.js

@@ -45,3 +45,3 @@

this._callbacks = this._callbacks || {};
(this._callbacks[event] = this._callbacks[event] || [])
(this._callbacks['$' + event] = this._callbacks['$' + event] || [])
.push(fn);

@@ -62,7 +62,4 @@ return this;

Emitter.prototype.once = function(event, fn){
var self = this;
this._callbacks = this._callbacks || {};
function on() {
self.off(event, on);
this.off(event, on);
fn.apply(this, arguments);

@@ -99,3 +96,3 @@ }

// specific event
var callbacks = this._callbacks[event];
var callbacks = this._callbacks['$' + event];
if (!callbacks) return this;

@@ -105,3 +102,3 @@

if (1 == arguments.length) {
delete this._callbacks[event];
delete this._callbacks['$' + event];
return this;

@@ -133,3 +130,3 @@ }

var args = [].slice.call(arguments, 1)
, callbacks = this._callbacks[event];
, callbacks = this._callbacks['$' + event];

@@ -156,3 +153,3 @@ if (callbacks) {

this._callbacks = this._callbacks || {};
return this._callbacks[event] || [];
return this._callbacks['$' + event] || [];
};

@@ -159,0 +156,0 @@

6

package.json
{
"name": "component-emitter",
"description": "Event emitter",
"version": "1.1.3",
"version": "1.2.0",
"license": "MIT",
"devDependencies": {

@@ -21,3 +22,4 @@ "mocha": "*",

"test": "make test"
}
},
"files": ["index.js", "LICENSE"]
}
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