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

ngraph.events

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngraph.events - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

20

index.js

@@ -17,3 +17,3 @@ module.exports = function(subject) {

// { 'eventName' => [{callback: function, ctx: object}] }
var registeredEvents = {};
var registeredEvents = Object.create(null);

@@ -25,6 +25,7 @@ return {

}
if (!registeredEvents.hasOwnProperty(eventName)) {
registeredEvents[eventName] = [];
var handlers = registeredEvents[eventName];
if (!handlers) {
handlers = registeredEvents[eventName] = [];
}
registeredEvents[eventName].push({callback: callback, ctx: ctx});
handlers.push({callback: callback, ctx: ctx});

@@ -38,7 +39,7 @@ return subject;

// Killing old events storage should be enough in this case:
registeredEvents = {};
registeredEvents = Object.create(null);
return subject;
}
if (registeredEvents.hasOwnProperty(eventName)) {
if (registeredEvents[eventName]) {
var deleteAllCallbacksForEvent = (typeof callback !== 'function');

@@ -61,8 +62,7 @@ if (deleteAllCallbacksForEvent) {

fire: function (eventName) {
var noEventsToFire = !registeredEvents.hasOwnProperty(eventName);
if (noEventsToFire) {
return subject;
var callbacks = registeredEvents[eventName];
if (!callbacks) {
return subject;
}
var callbacks = registeredEvents[eventName];
var fireArguments;

@@ -69,0 +69,0 @@ if (arguments.length > 1) {

{
"name": "ngraph.events",
"version": "0.0.2",
"version": "0.0.3",
"description": "Basic events supoort for ngraph.js ",

@@ -5,0 +5,0 @@ "main": "index.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