update method

  1. @protected
void update(
  1. StateUpdateCallback<TState> callback
)

Functional state update — applies callback to the current value and writes the result.

Equivalent to state = callback(state) but reads the underlying field directly (bypassing state's reactive reportObserved): an update is a write, not an observation, so the caller must not be registered as a reactive dependent. Listener dispatch + equality filtering run the same way as direct state = ... writes.

Implementation

@protected
void update(StateUpdateCallback<TState> callback) {
  _internalState.update(callback);
}