UseStreamOptions
Defined in: react-hooks/src/use-stream.ts:14
Stream hook options.
Properties
Section titled “Properties”initialText?
Section titled “initialText?”
optionalinitialText:string
Defined in: react-hooks/src/use-stream.ts:22
Initial text value
onChunk()?
Section titled “onChunk()?”
optionalonChunk: (chunk) =>void
Defined in: react-hooks/src/use-stream.ts:16
Called for each chunk
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
onComplete()?
Section titled “onComplete()?”
optionalonComplete: (fullText) =>void
Defined in: react-hooks/src/use-stream.ts:18
Called when stream completes
Parameters
Section titled “Parameters”fullText
Section titled “fullText”string
Returns
Section titled “Returns”void
onError()?
Section titled “onError()?”
optionalonError: (error) =>void
Defined in: react-hooks/src/use-stream.ts:20
Called on error
Parameters
Section titled “Parameters”Error
Returns
Section titled “Returns”void