From e96beead4fa9b5c7a0fb72cb0745ae6ef4784afa Mon Sep 17 00:00:00 2001 From: Marcin Mosiejko Date: Wed, 20 Mar 2024 16:37:07 +0100 Subject: [PATCH] eSDB: add dispatch event after queueing main event --- src/EventSourcingDB/EventSourcingDB.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/EventSourcingDB/EventSourcingDB.js b/src/EventSourcingDB/EventSourcingDB.js index 0772f07..9987ba4 100644 --- a/src/EventSourcingDB/EventSourcingDB.js +++ b/src/EventSourcingDB/EventSourcingDB.js @@ -465,6 +465,7 @@ class EventSourcingDB extends EventEmitter { */ dispatch = makeDispatcher('dispatch', async (type, data, ts) => { const event = await this.queue.add(type, data, ts) + this.emit('dispatch', event) return this.handledVersion(event.v) })