OptimisticUpdate

typealias OptimisticUpdate<T, D> = (currentState: T, optimisticValue: D) -> T

Function type for updating state with optimistic values.

Return

The updated state after applying the optimistic value.

Parameters

T

The type of the current state.

D

The type of the optimistic value.