Skip to content

Commit ef98ae5

Browse files
committed
is this syntax equivalent?
1 parent 8f5c0b5 commit ef98ae5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/dd-trace/src/dcitm.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,15 @@ function DcitmHook (moduleNames, options, onrequire) {
2424
payload.module = onrequire(payload.module, payload.path, undefined, payload.version)
2525
}
2626

27+
const channel = dc.channel(`${CHANNEL_PREFIX}:${moduleName}`)
28+
2729
for (const moduleName of moduleNames) {
28-
dc.subscribe(`${CHANNEL_PREFIX}:${moduleName}`, onModuleLoad)
30+
channel.subscribe(onModuleLoad)
2931
}
3032

3133
this.unhook = function dcitmUnload () {
3234
for (const moduleName of moduleNames) {
33-
dc.unsubscribe(`${CHANNEL_PREFIX}:${moduleName}`, onModuleLoad)
35+
channel.unsubscribe(onModuleLoad)
3436
}
3537
}
3638
}

0 commit comments

Comments
 (0)