TransactionConfig
A named transaction declared in
createDb
: one request sends all of its writes
Import
import { TransactionConfig } from "@hyper-fetch/db"
Source
Package
Preview
type TransactionConfig = {
mutationFn: (context: { id: string; mutations: TransactionWrite[] }) => RequestInstance;
onSuccess?: keep | refetch;
}
Structure
TransactionConfig
| Name | Type | Description |
|---|---|---|
| onSuccess | | What happens to the changes once the request succeeds:
|
| mutationFn | | Returns the request that sends the writes. The transaction id is an idempotency key. |
