API Documentation / @pinia/colada / StreamedMutationOptions_WithoutReducer
Interface: StreamedMutationOptions_WithoutReducer<TChunk, TVars>
Options for streamedMutation that collect the chunks into an array.
Extends
StreamedMutationOptions_Base<TChunk,TVars>
Type Parameters
TChunk
TChunk
TVars
TVars
Properties
initialValue?
ts
initialValue?: TChunk[];Data used before the first chunk arrives.
Default
ts
[]reducer?
ts
reducer?: undefined;stream
ts
stream: (vars, 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 mutation data as soon as it arrives. Pass the signal to your requests to stop the stream when the mutation is cancelled.
Parameters
vars
TVars
context
Returns
| AsyncIterable<TChunk, any, any> | Promise<AsyncIterable<TChunk, any, any>>