From 0ead540a9619ce325452cf3a3d8c3f7ace808766 Mon Sep 17 00:00:00 2001 From: bratelefant Date: Fri, 22 Aug 2025 14:32:57 +0200 Subject: [PATCH] possible fix for #167 --- lib/ddp.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/ddp.js b/lib/ddp.js index 6c2bef52..9b34a33a 100644 --- a/lib/ddp.js +++ b/lib/ddp.js @@ -203,11 +203,12 @@ class DDP extends EventEmitter { } /** - * Emits a new event. Wraps emitting in a setTimeout (macrotask) + * Emits a new event. * @override */ - emit() { - setTimeout(super.emit.bind(this, ...arguments), 0); + emit(...args) { + Promise.resolve().then(() => super.emit(...args)); + return true; } /**