appProcess.registerOnStateChange
API reference for the appProcess.registerOnStateChange method.
Registers a callback that runs when the state of a process changes.
Usage
import { appProcess } from "@canva/platform";appProcess.current.registerOnStateChange("ID GOES HERE", (context) => {console.log(context.state); // => "open"});
tsx
Parameters
Required
The ID of a process.
Required
The callback to run when the state of the process changes.
Required
Information passed to the callback when the state of the process changes.
Required
The state of the process.
The possible values are:
"opening"
"open"
"closing"
"closed"
Returns
A disposer function that cleans up the registered callback.