Download src/lib/utils/template.ts from huggingface/inference-playground: direct link, hf CLI and curl.
- Browser
- Download file 464 Bytes
-
https://huggingface.co/spaces/huggingface/inference-playground/resolve/refs%2Fpr%2F13/src/lib/utils/template.ts
- Command line
-
hf download hf://spaces/huggingface/inference-playground@refs/pr/13/src/lib/utils/template.ts
-
curl -L -o template.ts https://huggingface.co/spaces/huggingface/inference-playground/resolve/refs%2Fpr%2F13/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); | |
| }, | |
| }; | |
| } | |