Skip to main content
Version: v10.0.0

DeleteMutation


Import
import { DeleteMutation } from "@hyper-fetch/db"

Preview​

type DeleteMutation<Row,KeyField,Req> = {
map: (key: NonNullable<Row[KeyField]>, context: MutationContext) => RequestPatch<Req>;
onSuccess?: MutationSuccessMode;
optimistic?: boolean;
outbox?: boolean;
request: Req;
}

Structure​

DeleteMutation
NameTypeDescription
onSuccess
MutationSuccessMode
optimistic
boolean

false when the backend applies writes locally on its own, such as Firestore, so the db adds no optimistic layer

outbox
boolean

false when the backend queues writes offline on its own, such as Firestore, so they skip the outbox

request
Req
map
(key: NonNullable<Row[KeyField]>, context: MutationContext) => RequestPatch<Req>