UpdateMutation
Import
import { UpdateMutation } from "@hyper-fetch/db"
Source
Package
Preview
type UpdateMutation<Row,KeyField,Req,Mapped,Success> = {
map: (key: NonNullable<Row[KeyField]>, changes: Partial<Row>, context: MutationContext) => RequestPatch<Req>;
onSuccess?: Success & MutationSuccessMode;
optimistic?: boolean;
outbox?: boolean;
request: Req;
row?: (response: ExtractResponseType<Req>) => Mapped;
}
Structure
UpdateMutation
| Name | Type | Description |
|---|---|---|
| onSuccess | | Needed when the response is not the row or its changed fields with the key |
| optimistic | |
|
| outbox | |
|
| request | | |
| map | | |
| row | | Reads the key and changed fields from the response |
