Skip to content
Source
Sign inSign up
TanStack/db
Open History to see the last commit

MutationFn.md

31 lines706 Bytes

type MutationFn<T> = (params) => Promise<any>;

Defined in: packages/db/src/types.ts:135

Persists an optimistic transaction. Do not start or await collection or live-query preloads here. Sync commits queue behind this function, so waiting for preload work that needs one of those commits can deadlock the mutation. Use the collection adapter's mutation acknowledgement helper instead.

Type Parameters

T

T extends object = Record<string, unknown>

Parameters

params

MutationFnParams<T>

Returns

Promise<any>