Skip to content

Commit 7cd4712

Browse files
authored
Merge pull request #168 from meteorrn/fix/event-emit
possible fix for #167
2 parents e84574c + 955e7fe commit 7cd4712

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/ddp.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,11 +203,12 @@ class DDP extends EventEmitter {
203203
}
204204

205205
/**
206-
* Emits a new event. Wraps emitting in a setTimeout (macrotask)
206+
* Emits a new event.
207207
* @override
208208
*/
209-
emit() {
210-
setTimeout(super.emit.bind(this, ...arguments), 0);
209+
emit(...args) {
210+
Promise.resolve().then(() => super.emit(...args));
211+
return true;
211212
}
212213

213214
/**

0 commit comments

Comments
 (0)