New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@codescouts/events

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@codescouts/events - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

2

lib/DomainEvents.d.ts

@@ -8,3 +8,3 @@ import { DomainEvent } from "./DomainEvent";

static remove<E extends DomainEvent>(handler: Handler<E>): void;
static register<E extends DomainEvent>(handler: Handler<E>, eventClassName: string): void;
static register<E extends DomainEvent>(handler: Handler<E>, eventClassName: string, removeCallbackSetter: (callback: Function) => void): void;
static dispatch<E extends DomainEvent>(event: E): void;

@@ -11,0 +11,0 @@ }

@@ -37,3 +37,4 @@ "use strict";

};
DomainEvents.register = function (handler, eventClassName) {
DomainEvents.register = function (handler, eventClassName, removeCallbackSetter) {
var _this = this;
if (!this.handlersMap.hasOwnProperty(eventClassName)) {

@@ -43,6 +44,7 @@ this.handlersMap[eventClassName] = [];

Object.defineProperty(handler, "name", {
value: Math.random().toString(36).substring(7),
value: Math.random().toString(36),
writable: true,
});
this.handlersMap[eventClassName].push(handler);
removeCallbackSetter(function () { return _this.remove(handler); });
};

@@ -49,0 +51,0 @@ DomainEvents.dispatch = function (event) {

@@ -5,2 +5,3 @@ import { DomainEvent } from "./DomainEvent";

export declare abstract class Handler<E extends DomainEvent> {
private onRemoveCallback;
protected readonly dispatcher: IEventDispatcher;

@@ -7,0 +8,0 @@ constructor(eventClassReference: Newly<E>);

@@ -7,9 +7,12 @@ "use strict";

function Handler(eventClassReference) {
var _this = this;
this.dispatcher = {
dispatch: function (event) { return DomainEvents_1.DomainEvents.dispatch(event); },
};
DomainEvents_1.DomainEvents.register(this.handle.bind(this), eventClassReference.name);
DomainEvents_1.DomainEvents.register(this.handle.bind(this), eventClassReference.name, function (callback) {
_this.onRemoveCallback = callback;
});
}
Handler.prototype.dispose = function () {
DomainEvents_1.DomainEvents.remove(this.handle.bind(this));
this.onRemoveCallback();
};

@@ -16,0 +19,0 @@ return Handler;

{
"name": "@codescouts/events",
"version": "1.0.6",
"version": "1.0.7",
"main": "./lib/index.js",

@@ -5,0 +5,0 @@ "types": "./lib/index.d.ts",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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