tryOnBeforeUnmount 
Safe onBeforeUnmount. Call onBeforeUnmount() if it's inside a component lifecycle, if not, do nothing
Usage 
js
import { tryOnBeforeUnmount } from '@vueuse/core'
tryOnBeforeUnmount(() => {
})Type Declarations 
typescript
/**
 * Call onBeforeUnmount() if it's inside a component lifecycle, if not, do nothing
 *
 * @param fn
 * @param target
 */
export declare function tryOnBeforeUnmount(fn: Fn, target?: any): void