Bot
This commit is contained in:
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.EventDispatcher = void 0;
|
||||
class EventDispatcher {
|
||||
publisher = new (require('./event-publisher').InMemoryEventPublisher)();
|
||||
register(handler) {
|
||||
this.publisher.register(handler);
|
||||
}
|
||||
async dispatch(event) {
|
||||
await this.publisher.publish(event);
|
||||
}
|
||||
}
|
||||
exports.EventDispatcher = EventDispatcher;
|
||||
//# sourceMappingURL=event-dispatcher.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"event-dispatcher.js","sourceRoot":"","sources":["../../../src/core/events/event-dispatcher.ts"],"names":[],"mappings":";;;AAEA,MAAa,eAAe;IAClB,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC,sBAAsB,CAAC,EAAE,CAAC;IAEhF,QAAQ,CAAC,OAA0C;QACjD,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,KAAkB;QAC/B,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;CACF;AAVD,0CAUC"}
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=event-handler.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"event-handler.js","sourceRoot":"","sources":["../../../src/core/events/event-handler.ts"],"names":[],"mappings":""}
|
||||
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.InMemoryEventPublisher = void 0;
|
||||
class InMemoryEventPublisher {
|
||||
handlers = [];
|
||||
register(handler) {
|
||||
this.handlers.push(handler);
|
||||
}
|
||||
async publish(event) {
|
||||
await Promise.all(this.handlers.map((h) => h(event)));
|
||||
}
|
||||
}
|
||||
exports.InMemoryEventPublisher = InMemoryEventPublisher;
|
||||
//# sourceMappingURL=event-publisher.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"event-publisher.js","sourceRoot":"","sources":["../../../src/core/events/event-publisher.ts"],"names":[],"mappings":";;;AAMA,MAAa,sBAAsB;IACzB,QAAQ,GAA6C,EAAE,CAAC;IAEhE,QAAQ,CAAC,OAA0C;QACjD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,KAAkB;QAC9B,MAAM,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACxD,CAAC;CACF;AAVD,wDAUC"}
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=event.interface.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"event.interface.js","sourceRoot":"","sources":["../../../src/core/events/event.interface.ts"],"names":[],"mappings":""}
|
||||
Reference in New Issue
Block a user