@meith/events 0.32.0 → 0.33.0
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.
- package/package.json +1 -1
- package/src/registry.ts +2 -2
- package/src/types.ts +1 -1
package/package.json
CHANGED
package/src/registry.ts
CHANGED
|
@@ -29,7 +29,7 @@ export class EventRegistry {
|
|
|
29
29
|
return this.byId.get(id)
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
async dispatch(handlerId: string, payload: unknown): Promise<void> {
|
|
32
|
+
async dispatch(handlerId: string, payload: unknown, signal?: AbortSignal): Promise<void> {
|
|
33
33
|
const handler = this.byId.get(handlerId)
|
|
34
34
|
|
|
35
35
|
if (!handler) {
|
|
@@ -40,7 +40,7 @@ export class EventRegistry {
|
|
|
40
40
|
return
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
await handler.handle(payload as DomainEventMap[DomainEventName])
|
|
43
|
+
await handler.handle(payload as DomainEventMap[DomainEventName], signal)
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
ids(): readonly string[] {
|
package/src/types.ts
CHANGED
|
@@ -55,5 +55,5 @@ export interface OutboxRecord {
|
|
|
55
55
|
export interface EventHandler<N extends DomainEventName = DomainEventName> {
|
|
56
56
|
readonly id: string
|
|
57
57
|
readonly event: N
|
|
58
|
-
handle(payload: DomainEventMap[N]): Promise<void>
|
|
58
|
+
handle(payload: DomainEventMap[N], signal?: AbortSignal): Promise<void>
|
|
59
59
|
}
|