pre-release commit

This commit is contained in:
koalazf.99
2025-07-22 19:59:07 +08:00
parent c5dee4bb17
commit a9d6965bef
485 changed files with 111444 additions and 2 deletions

View File

@@ -0,0 +1,22 @@
/**
* @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;
};