unlisten
unlisten(messageName, *bundleName, handlerFunc)
→ {boolean}
Removes a listener for a message.
Messages are namespaced by bundle. To remove a listener to a message in another bundle's namespace, provide it as the second argument.
Parameters
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
messageName | string | The name of the message. | ||
bundleName | string | <optional> | Current bundle | The bundle namespace to in which to listen for this message |
handlerFunc | function | A reference to a handler function added as a listener to this message via listenFor. |
Example
nodecg.unlisten('printMessage', someFunctionName);
Removing a listener from a message in another bundle's namespace:
nodecg.unlisten('printMessage', 'another-bundle', someFunctionName);