UseStreamBaseOptions
type UseStreamBaseOptions<TYield, TReturn> = object;Defined in: stream-renderer.tsx:223
Base options shared by all useStream configurations
Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
TYield |
- |
TReturn |
void |
Properties
Section titled “Properties”delay?
Section titled “delay?”delay?: number | DelayConfig;Defined in: stream-renderer.tsx:234
Delay configuration for visualizing sync streams
enabled?
Section titled “enabled?”enabled?: boolean;Defined in: stream-renderer.tsx:242
Whether to start streaming immediately (default: true)
onError?
Section titled “onError?”onError?: (data) => void;Defined in: stream-renderer.tsx:240
Called when stream errors
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
data |
OnErrorData<TYield> |
Returns
Section titled “Returns”void
onItem?
Section titled “onItem?”onItem?: (data) => void;Defined in: stream-renderer.tsx:236
Called for each item received
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
data |
OnItemData<TYield> |
Returns
Section titled “Returns”void
onSuccess?
Section titled “onSuccess?”onSuccess?: (data) => void;Defined in: stream-renderer.tsx:238
Called when stream completes successfully
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
data |
OnSuccessData<TYield, TReturn> |
Returns
Section titled “Returns”void
queryKey?
Section titled “queryKey?”queryKey?: unknown[];Defined in: stream-renderer.tsx:232
Key for the query cache. Include everything the stream depends on: a new key
starts a new stream, and hooks with the same key share one stream. When
omitted, the stream is private to this hook instance (stable across renders,
not shared with other components) and does not restart when source changes.
retry?
Section titled “retry?”retry?: boolean | number | ((data) => boolean);Defined in: stream-renderer.tsx:250
Retry configuration on error (default: false = no retries)
false: no retriestrue: use TanStack Query default (3 retries)number: retry that many times(data) => boolean: custom retry logic with access to partial data
source
Section titled “source”source: | UseStreamSource<TYield, TReturn> | null | undefined;Defined in: stream-renderer.tsx:225
The stream source - can be instance or factory