DB Docs
API Reference
- Core API Reference
- Collection
- createCollection
- liveQueryCollectionOptions
- createLiveQueryCollection
- createOptimisticAction
- createTransaction
- Electric DB Collection
- electricCollectionOptions
- Query DB Collection
- queryCollectionOptions
- RxDB DB Collection
- rxdbCollectionOptions
- PowerSync Collection
- powerSyncCollectionOptions
- createIndexedDB
- indexedDBCollectionOptions
- React Hooks
- useLiveQuery
AI/LLM: This documentation page is available in plain markdown format at/db/latest/docs/reference/type-aliases/MutationFn.md
MutationFn
ts
type MutationFn<T> = (params) => Promise<any>;Defined in: packages/db/src/types.ts:143
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#
Returns#
Promise<any>