Spaces:
Paused
Paused
Download web/src/lib/state/dialogs.ts from Lordgrim7/cobalt-api: direct link, hf CLI and curl.
- Browser
- Download file 501 Bytes
-
https://huggingface.co/spaces/Lordgrim7/cobalt-api/resolve/main/web/src/lib/state/dialogs.ts
- Command line
-
hf download hf://spaces/Lordgrim7/cobalt-api/web/src/lib/state/dialogs.ts
-
curl -L -o dialogs.ts https://huggingface.co/spaces/Lordgrim7/cobalt-api/resolve/main/web/src/lib/state/dialogs.ts
501 Bytes
| import { readable, type Updater } from "svelte/store"; | |
| import type { DialogInfo } from "$lib/types/dialog"; | |
| let update: (_: Updater<DialogInfo[]>) => void; | |
| export default readable<DialogInfo[]>( | |
| [], | |
| (_, _update) => { update = _update } | |
| ); | |
| export function createDialog(newData: DialogInfo) { | |
| update((popups) => { | |
| popups.push(newData); | |
| return popups; | |
| }); | |
| } | |
| export function killDialog() { | |
| update((popups) => { | |
| popups.pop() | |
| return popups; | |
| }); | |
| } | |