Spaces:
Build error
Build error
Download frontend/src/lib/liveblocks/useStorage.ts from ejfox/stable-diffusion-multiplayer: direct link, hf CLI and curl.
- Browser
- Download file 582 Bytes
-
https://huggingface.co/spaces/ejfox/stable-diffusion-multiplayer/resolve/main/frontend/src/lib/liveblocks/useStorage.ts
- Command line
-
hf download hf://spaces/ejfox/stable-diffusion-multiplayer/frontend/src/lib/liveblocks/useStorage.ts
-
curl -L -o useStorage.ts https://huggingface.co/spaces/ejfox/stable-diffusion-multiplayer/resolve/main/frontend/src/lib/liveblocks/useStorage.ts
582 Bytes
| // @ts-nocheck | |
| import type { LiveObject } from "@liveblocks/client"; | |
| import type { Writable } from "svelte/store"; | |
| import { writable } from "svelte/store"; | |
| import { useRoom } from "./useRoom"; | |
| /** | |
| * No `liveblocks-react` public API equivalent, but useStorage is used internally | |
| */ | |
| export function useStorage(): Writable<LiveObject> { | |
| const room = useRoom(); | |
| const rootStore = writable<LiveObject>(); | |
| async function fetchStorage() { | |
| const { root }: { root: LiveObject } = await room!.getStorage(); | |
| rootStore.set(root); | |
| } | |
| fetchStorage(); | |
| return rootStore; | |
| } | |