Download packages/tui/src/context/prompt.tsx from SaylorTwift/opencode: direct link, hf CLI and curl.
- Browser
- Download file 418 Bytes
-
https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/tui/src/context/prompt.tsx
- Command line
-
hf download hf://SaylorTwift/opencode/packages/tui/src/context/prompt.tsx
-
curl -L -o prompt.tsx https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/tui/src/context/prompt.tsx
418 Bytes
| import { createSimpleContext } from "./helper" | |
| import type { PromptRef } from "../component/prompt" | |
| export const { use: usePromptRef, provider: PromptRefProvider } = createSimpleContext({ | |
| name: "PromptRef", | |
| init: () => { | |
| let current: PromptRef | undefined | |
| return { | |
| get current() { | |
| return current | |
| }, | |
| set(ref: PromptRef | undefined) { | |
| current = ref | |
| }, | |
| } | |
| }, | |
| }) | |