We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d61af69 commit c1f7d2aCopy full SHA for c1f7d2a
1 file changed
lib/handler/decorator-handler.js
@@ -1,11 +1,9 @@
1
'use strict'
2
3
const assert = require('node:assert')
4
-const noop = () => {}
5
6
module.exports = class DecoratorHandler {
7
#handler
8
- #onConnectCalled = false
9
#onCompleteCalled = false
10
#onErrorCalled = false
11
@@ -17,16 +15,10 @@ module.exports = class DecoratorHandler {
17
15
}
18
16
19
onConnect (...args) {
20
- this.#onConnectCalled = true
21
return this.#handler.onConnect?.(...args)
22
23
24
onError (...args) {
25
- if (!this.#onConnectCalled) {
26
27
- this.#handler.onConnect?.(noop)
28
- }
29
-
30
this.#onErrorCalled = true
31
return this.#handler.onError?.(...args)
32
0 commit comments