R
fn

tryOnMounted

v0.0.1testeddemo

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

Examples

ts
tryOnMounted(() => console.log('Mounted!'));
ts
tryOnMounted(() => console.log('Mounted!'), { sync: false });

Demo

Loading demo…

Signature

ts
export function tryOnMounted(fn: VoidFunction, options: TryOnMountedOptions ={ ... }

Parameters

ParameterTypeDescription
fnVoidFunctionThe function to call
options?TryOnMountedOptionsThe options to use