import { onDestroy, onMount } from 'svelte'; | |
export const safeOnMount = (fn) => { | |
try { | |
onMount(fn); | |
} | |
catch { | |
return fn; | |
} | |
}; | |
export const safeOnDestroy = (fn) => { | |
try { | |
onDestroy(fn); | |
} | |
catch { | |
return fn; | |
} | |
}; | |
import { onDestroy, onMount } from 'svelte'; | |
export const safeOnMount = (fn) => { | |
try { | |
onMount(fn); | |
} | |
catch { | |
return fn; | |
} | |
}; | |
export const safeOnDestroy = (fn) => { | |
try { | |
onDestroy(fn); | |
} | |
catch { | |
return fn; | |
} | |
}; | |