ddd-node 22.0.0 → 22.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -5,9 +5,9 @@ export interface IEventSubscriber<T extends AnyEvent = AnyEvent> {
|
|
|
5
5
|
}
|
|
6
6
|
export type EventSubscriberHandler<T extends AnyEvent = AnyEvent> = IEventSubscriber<T>["handleEvent"];
|
|
7
7
|
export declare class EventSubscriber<T extends AnyEvent = AnyEvent> implements IEventSubscriber<T> {
|
|
8
|
-
private readonly
|
|
8
|
+
private readonly subscribedEvents;
|
|
9
9
|
private readonly eventHandler;
|
|
10
|
-
constructor(
|
|
11
|
-
subscribeToEvents(): EventClass<T, any[]
|
|
10
|
+
constructor(subscribedEvents: EventClass<T> | EventClass<T>[], eventHandler: EventSubscriberHandler<T>);
|
|
11
|
+
subscribeToEvents(): EventClass<T, any[]> | EventClass<T, any[]>[];
|
|
12
12
|
handleEvent(event: T): Promise<void>;
|
|
13
13
|
}
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EventSubscriber = void 0;
|
|
4
4
|
class EventSubscriber {
|
|
5
|
-
constructor(
|
|
6
|
-
this.
|
|
5
|
+
constructor(subscribedEvents, eventHandler) {
|
|
6
|
+
this.subscribedEvents = subscribedEvents;
|
|
7
7
|
this.eventHandler = eventHandler;
|
|
8
8
|
}
|
|
9
9
|
subscribeToEvents() {
|
|
10
|
-
return this.
|
|
10
|
+
return this.subscribedEvents;
|
|
11
11
|
}
|
|
12
12
|
handleEvent(event) {
|
|
13
13
|
return this.eventHandler(event);
|
package/dist/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"ddd-node","version":"22.0.
|
|
1
|
+
{"name":"ddd-node","version":"22.0.1","description":"Domain Driven Design base for NodeJs","type":"commonjs","main":"index.js","types":"index.d.ts","files":["dist"],"repository":{"type":"git","url":"https://github.com/nqd881/ddd-node"},"keywords":["ddd","ddd-node","ddd-base","ddd-ts","ddd-js"],"author":"Quoc Dai","license":"ISC","devDependencies":{"@types/chai":"^4.3.16","@types/lodash":"^4.14.200","@types/mocha":"^10.0.6","@types/uuid":"^9.0.6","chai":"^5.1.1","chai-deep-match":"^1.2.1","ddd-node":"file:dist","mocha":"^10.4.0","ts-node":"^10.9.1","tsconfig-paths":"^4.2.0","typescript":"^5.2.2"},"dependencies":{"lodash":"^4.17.21","reflect-metadata":"^0.1.13","tsc-alias":"^1.8.8","type-fest":"^4.20.1","uuid":"^9.0.1"}}
|