update method

void update(
  1. T reducer(
    1. T state
    )
)

Updates the state by applying a reducer function to the current value.

// Example usage:

state.update((s) => s.copyWith(count: s.count + 1));

Implementation

void update(T Function(T state) reducer) {
  _setValueInternal(reducer(value));
}