R
fn

tryOnBeforeMount

v0.0.1demo

Call onBeforeMount if it's inside a component lifecycle hook, otherwise just calls it

Examples

ts
tryOnBeforeMount(() => console.log('Before mount'));
ts
tryOnBeforeMount(() => console.log('Before mount async'), { sync: false });

Demo

Loading demo…

Signature

ts
export function tryOnBeforeMount(fn: VoidFunction, options: TryOnBeforeMountOptions ={ ... }

Parameters

ParameterTypeDescription
fnVoidFunctionThe function to run on before mount.
options?TryOnBeforeMountOptionsThe options for the function.