Retree - v1.0.0
    Preparing search index...

    Interface IOptimisticTransform<TState, Mutation>

    Imperative optimistic state transform for a ConvexQueryNode.

    interface IOptimisticTransform<
        TState,
        Mutation extends MutationReference = MutationReference,
    > {
        ctx?: OptimisticUpdateContext<Mutation>;
        revert?: (state: TState, snapshot: TState) => void;
        apply(state: TState): void;
    }

    Type Parameters

    Index

    Properties

    Methods

    Properties

    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.

    revert?: (state: TState, snapshot: TState) => void

    Optional custom rollback. When omitted, Retree Convex restores a snapshot captured before IOptimisticTransform.apply ran.

    Methods