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 82477d7 commit ee35bb0Copy full SHA for ee35bb0
lib/agent.js
@@ -54,22 +54,20 @@ class Agent extends DispatcherBase {
54
this[kFactory] = factory
55
this[kClients] = new Map()
56
57
- const agent = this
58
-
59
this[kOnDrain] = (origin, targets) => {
60
- agent.emit('drain', origin, [agent, ...targets])
+ this.emit('drain', origin, [this, ...targets])
61
}
62
63
this[kOnConnect] = (origin, targets) => {
64
- agent.emit('connect', origin, [agent, ...targets])
+ this.emit('connect', origin, [this, ...targets])
65
66
67
this[kOnDisconnect] = (origin, targets, err) => {
68
- agent.emit('disconnect', origin, [agent, ...targets], err)
+ this.emit('disconnect', origin, [this, ...targets], err)
69
70
71
this[kOnConnectionError] = (origin, targets, err) => {
72
- agent.emit('connectionError', origin, [agent, ...targets], err)
+ this.emit('connectionError', origin, [this, ...targets], err)
73
74
75
0 commit comments