Skip to content

UseStreamReturn

Defined in: react-hooks/src/use-stream.ts:28

Stream hook return value.

error: Error | undefined

Defined in: react-hooks/src/use-stream.ts:34

Error if any


isStreaming: boolean

Defined in: react-hooks/src/use-stream.ts:32

Whether streaming is active


reset: () => void

Defined in: react-hooks/src/use-stream.ts:44

Reset state

void


setText: (text) => void

Defined in: react-hooks/src/use-stream.ts:46

Manually set text

string

void


startAsyncIterable: (iterable) => Promise<string>

Defined in: react-hooks/src/use-stream.ts:40

Start streaming from an async iterable

AsyncIterable<string>

Promise<string>


startReadableStream: (stream) => Promise<string>

Defined in: react-hooks/src/use-stream.ts:38

Start streaming from a ReadableStream

ReadableStream<Uint8Array<ArrayBufferLike>>

Promise<string>


startStream: (response) => Promise<string>

Defined in: react-hooks/src/use-stream.ts:36

Start streaming from a response

Response

Promise<string>


stop: () => void

Defined in: react-hooks/src/use-stream.ts:42

Stop streaming

void


text: string

Defined in: react-hooks/src/use-stream.ts:30

Current streamed text