Skip to content

API Documentation / @pinia/colada / UseMutationEntry

Interface: UseMutationEntry<TData, TVars, TError, TContext>

A mutation entry in the cache.

Type Parameters

TData

TData = unknown

TVars

TVars = unknown

TError

TError = unknown

TContext

TContext extends Record<any, any> = _EmptyObject

Properties

asyncStatus

ts
asyncStatus: ShallowRef<AsyncStatus>;

The async status of the mutation.


ext

ts
ext: UseMutationEntryExtensions<TData, TVars, TError, TContext>;

Extensions to the mutation entry added by plugins.


gcTimeout

ts
gcTimeout: Timeout | undefined;

Timeout id that scheduled a garbage collection. It is set here to clear it when the entry is used by a different component.


id

ts
id: string;

Unique id of the mutation entry. Empty string if the entry is not yet in the cache.


key

ts
key: EntryKey | undefined;

The serialized key associated with this mutation entry.


keyHash

ts
keyHash: string | undefined;

Seriaized version of the key. Used to retrieve the entry from the cache. Can be undefined if the entry has no key.


options

ts
options: UseMutationOptions<TData, TVars, TError, TContext>;

Options used to create the mutation.


state

ts
state: ShallowRef<DataState<TData, TError>>;

The state of the mutation. Contains the data, error and status.


vars

ts
vars: TVars | undefined;

The variables used to call the mutation.


when

ts
when: number;

When was this data fetched the last time in ms

Released under the MIT License.