From 68373c96cea686d18a3ce66486c13d382954d53d Mon Sep 17 00:00:00 2001 From: Yury Ivaniutsenka Date: Mon, 21 Aug 2023 15:28:39 +0200 Subject: [PATCH] fix(ChangeStream): add _bindEvents to addListener function --- lib/cursor/ChangeStream.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/cursor/ChangeStream.js b/lib/cursor/ChangeStream.js index 13556a809ec..1b193c39cf0 100644 --- a/lib/cursor/ChangeStream.js +++ b/lib/cursor/ChangeStream.js @@ -128,6 +128,11 @@ class ChangeStream extends EventEmitter { return this.driverChangeStream.next(cb); } + addListener(event, handler) { + this._bindEvents(); + return super.addListener(event, handler); + } + on(event, handler) { this._bindEvents(); return super.on(event, handler);