Skip to content

API Documentation / @pinia/colada / StreamedMutationOptions_Base

Interface: StreamedMutationOptions_Base<TChunk, TVars> ​

Options for streamedMutation without the reducer and initialValue.

Extended by ​

Type Parameters ​

TChunk ​

TChunk

TVars ​

TVars

Properties ​

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 ​

StreamedMutationFnContext

Returns ​

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

Released under the MIT License.