Download frontend/src/App.svelte from openfree/graphite2: direct link, hf CLI and curl.
- Browser
- Download file 498 Bytes
-
https://huggingface.co/spaces/openfree/graphite2/resolve/main/frontend/src/App.svelte
- Command line
-
hf download hf://spaces/openfree/graphite2/frontend/src/App.svelte
-
curl -L -o App.svelte https://huggingface.co/spaces/openfree/graphite2/resolve/main/frontend/src/App.svelte
498 Bytes
| <script lang="ts"> | |
| import { onMount, onDestroy } from "svelte"; | |
| import { type Editor as GraphiteEditor, initWasm, createEditor } from "@graphite/editor"; | |
| import Editor from "@graphite/components/Editor.svelte"; | |
| let editor: GraphiteEditor | undefined = undefined; | |
| onMount(async () => { | |
| await initWasm(); | |
| editor = createEditor(); | |
| }); | |
| onDestroy(() => { | |
| // Destroy the WASM editor handle | |
| editor?.handle.free(); | |
| }); | |
| </script> | |
| {#if editor !== undefined} | |
| <Editor {editor} /> | |
| {/if} | |