Download packages/cli/src/ui/contexts/StreamingContext.tsx from Jimmi42/openCLI: direct link, hf CLI and curl.
- Browser
- Download file 547 Bytes
-
https://huggingface.co/Jimmi42/openCLI/resolve/main/packages/cli/src/ui/contexts/StreamingContext.tsx
- Command line
-
hf download hf://Jimmi42/openCLI/packages/cli/src/ui/contexts/StreamingContext.tsx
-
curl -L -o StreamingContext.tsx https://huggingface.co/Jimmi42/openCLI/resolve/main/packages/cli/src/ui/contexts/StreamingContext.tsx
547 Bytes
| /** | |
| * @license | |
| * Copyright 2025 Google LLC | |
| * SPDX-License-Identifier: Apache-2.0 | |
| */ | |
| import React, { createContext } from 'react'; | |
| import { StreamingState } from '../types.js'; | |
| export const StreamingContext = createContext<StreamingState | undefined>( | |
| undefined, | |
| ); | |
| export const useStreamingContext = (): StreamingState => { | |
| const context = React.useContext(StreamingContext); | |
| if (context === undefined) { | |
| throw new Error( | |
| 'useStreamingContext must be used within a StreamingContextProvider', | |
| ); | |
| } | |
| return context; | |
| }; | |