Spaces:
Runtime error
Runtime error
Download src/lib/utils/lifecycle.ts from FallnAI/LLM-Inference: direct link, hf CLI and curl.
- Browser
- Download file 295 Bytes
-
https://huggingface.co/spaces/FallnAI/LLM-Inference/resolve/0ff4ef88e52ae018ce84a5c4cc1cd2d14ff35135/src/lib/utils/lifecycle.ts
- Command line
-
hf download hf://spaces/FallnAI/LLM-Inference@0ff4ef88e52ae018ce84a5c4cc1cd2d14ff35135/src/lib/utils/lifecycle.ts
-
curl -L -o lifecycle.ts https://huggingface.co/spaces/FallnAI/LLM-Inference/resolve/0ff4ef88e52ae018ce84a5c4cc1cd2d14ff35135/src/lib/utils/lifecycle.ts
295 Bytes
| import { onDestroy, onMount } from "svelte"; | |
| export const safeOnMount = (fn: (...args: unknown[]) => unknown) => { | |
| try { | |
| onMount(fn); | |
| } catch { | |
| return fn; | |
| } | |
| }; | |
| export const safeOnDestroy = (fn: (...args: unknown[]) => unknown) => { | |
| try { | |
| onDestroy(fn); | |
| } catch { | |
| return fn; | |
| } | |
| }; | |