API Documentation / @pinia/colada / StreamedQueryOptions_WithoutReducer
Interface: StreamedQueryOptions_WithoutReducer<TChunk>
Options for streamedQuery that collect the chunks into an array.
Extends
StreamedQueryOptions_Base<TChunk>
Type Parameters
TChunk
TChunk
Properties
initialValue?
ts
initialValue?: TChunk[];Data used before the first chunk arrives.
Default
ts
[]reducer?
ts
reducer?: undefined;refetchMode?
ts
refetchMode?: StreamedQueryRefetchMode;What to do with the existing data when the query is fetched again.
Default
ts
'reset'See
Inherited from
StreamedQueryOptions_Base.refetchMode
stream
ts
stream: (context) =>
| AsyncIterable<TChunk, any, any>
| Promise<AsyncIterable<TChunk, any, any>>;Function that returns an AsyncIterable (e.g. an async generator). Each chunk is added to the query data as soon as it arrives. Pass the signal to your requests to stop the stream when the query is cancelled.
Parameters
context
Returns
| AsyncIterable<TChunk, any, any> | Promise<AsyncIterable<TChunk, any, any>>