update method

  1. @override
S update(
  1. Updater<S> updater
)
override

Updates the current state.

Implementation

@override
S update(Updater<S> updater) {
  if (isUpdating) {
    throw StateError(
        'You may not call `Store.update` while updating. The update function '
        'has already received the state as an argument. Pass it down the '
        'call chain to manipulate it.');
  }
  isUpdating = true;
  try {
    return delegate.update(updater);
  } finally {
    isUpdating = false;
  }
}