Skip to content

textmode.js / plugins / TextmodePluginContext / registerPreSetupHook

Method: registerPreSetupHook()

ts
registerPreSetupHook(callback): () => void;

Register a callback to be invoked before the user's setup callback runs. This happens after the Textmodifier and all layers are fully initialized, but before user code in setup() executes. Useful for plugins that need to prepare resources or state before user setup.

Parameters

ParameterTypeDescription
callbackSetupLifecycleHookThe callback to invoke before setup.

Returns

A function to unregister the hook.

() => void

Example