function unsubscribe
Usage in Deno
import { unsubscribe } from "node:diagnostics_channel";
unsubscribe(name: string | symbol,onMessage: ChannelListener,): boolean
Remove a message handler previously registered to this channel with subscribe.
import diagnostics_channel from 'node:diagnostics_channel'; function onMessage(message, name) { // Received data } diagnostics_channel.subscribe('my-channel', onMessage); diagnostics_channel.unsubscribe('my-channel', onMessage);
onMessage: ChannelListener
The previous subscribed handler to remove
boolean
true
if the handler was found, false
otherwise.