diff options
| author | Frank <[email protected]> | 2025-08-29 23:32:17 -0400 |
|---|---|---|
| committer | Frank <[email protected]> | 2025-08-29 23:32:17 -0400 |
| commit | 37f284f9a97d3354143d64fc76c2eb9f7d9ccf9e (patch) | |
| tree | 053db9abcb2178c71b22ebeadd07f920750ef5d2 /cloud/web/src/util | |
| parent | 0178eab29bda2f1b37a29543cd313ede48ad3977 (diff) | |
| download | opencode-37f284f9a97d3354143d64fc76c2eb9f7d9ccf9e.tar.gz opencode-37f284f9a97d3354143d64fc76c2eb9f7d9ccf9e.zip | |
wip: cloud
Diffstat (limited to 'cloud/web/src/util')
| -rw-r--r-- | cloud/web/src/util/context.tsx | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/cloud/web/src/util/context.tsx b/cloud/web/src/util/context.tsx deleted file mode 100644 index d1c6f4e7f..000000000 --- a/cloud/web/src/util/context.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import { ParentProps, Show, createContext, useContext } from "solid-js" - -export function createInitializedContext< - Name extends string, - T extends { ready: boolean }, ->(name: Name, cb: () => T) { - const ctx = createContext<T>() - - return { - use: () => { - const context = useContext(ctx) - if (!context) throw new Error(`No ${name} context`) - return context - }, - provider: (props: ParentProps) => { - const value = cb() - return ( - <Show when={value.ready}> - <ctx.Provider value={value} {...props}> - {props.children} - </ctx.Provider> - </Show> - ) - }, - } -} |
