API reference · generated from source
Interface: IOptimisticTransform<TState, Mutation>#
Defined in: retree-convex/src/types.ts:298
Imperative optimistic state transform for a ConvexQueryNode.
Type Parameters#
| Type Parameter | Default type |
|---|---|
TState | - |
Mutation extends MutationReference | MutationReference |
Properties#
| Property | Type | Description | Defined in |
|---|---|---|---|
ctx? | OptimisticUpdateContext<Mutation> | Optional mutation context. When provided, Retree Convex rolls this optimistic state back if the mutation promise rejects before a newer server value resolves the dirty state. | retree-convex/src/types.ts:307 |
revert? | (state, snapshot) => void | Optional custom rollback. When omitted, Retree Convex restores a snapshot captured before IOptimisticTransform.apply ran. | retree-convex/src/types.ts:316 |
Methods#
apply()#
apply(state): void;Defined in: retree-convex/src/types.ts:311
Apply an optimistic change to the current query state.
Parameters#
| Parameter | Type |
|---|---|
state | TState |
Returns#
void