Skip to content

API Documentation / @pinia/colada / StreamedQueryOptions_WithoutReducer

Interface: StreamedQueryOptions_WithoutReducer<TChunk> ​

Options for streamedQuery that collect the chunks into an array.

Extends ​

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 ​

StreamedQueryRefetchMode

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 ​

StreamedQueryFnContext

Returns ​

| AsyncIterable<TChunk, any, any> | Promise<AsyncIterable<TChunk, any, any>>

Inherited from ​

StreamedQueryOptions_Base.stream

Released under the MIT License.