Registers a callback that runs when a process broadcasts a message.
Usage
import { appProcess } from "@canvas/platform";appProcess.registerOnMessage((sender, message) => {console.log(sender);console.log(message);});
tsx
Parameters
Required
The callback that runs when a process broadcasts a message.
Required
The process that broadcasted the message.
Required
The surface of the process that broadcasted the message.
The possible values are:
"object_panel"
"selected_image_overlay"
Required
The ID of the process that broadcasted the message.
Optional
The launch parameters of the process that broadcasted the message.
Required
The message broadcasted by the process. This can be a primitive value (e.g. a boolean), a literal (e.g. a string), or a more complex value (e.g. a deeply nested object).
Returns
A disposer function that cleans up the registered callback.