Spaces:
Paused
Paused
Download src/lib/utils/template.ts from Nymbo/inference-playground: direct link, hf CLI and curl.
- Browser
- Download file 464 Bytes
-
https://huggingface.co/spaces/Nymbo/inference-playground/resolve/main/src/lib/utils/template.ts
- Command line
-
hf download hf://spaces/Nymbo/inference-playground/src/lib/utils/template.ts
-
curl -L -o template.ts https://huggingface.co/spaces/Nymbo/inference-playground/resolve/main/src/lib/utils/template.ts
464 Bytes
| export function onchange(cb: (value: string, e: Event) => void): { onchange: (e: Event) => void } { | |
| return { | |
| onchange: (e: Event) => { | |
| const el = e.target as HTMLInputElement; | |
| if (!el) return; | |
| cb(el.value, e); | |
| }, | |
| }; | |
| } | |
| export function oninput(cb: (value: string, e: Event) => void): { oninput: (e: Event) => void } { | |
| return { | |
| oninput: (e: Event) => { | |
| const el = e.target as HTMLInputElement; | |
| if (!el) return; | |
| cb(el.value, e); | |
| }, | |
| }; | |
| } | |