update method

void update(
  1. S newState, {
  2. bool force = false,
})
inherited

Change the State value.

This also stores the state value to be retrieved using the undo() method when using MementoMixin

Implementation

void update(State newState, {bool force = false}) {
  var candidate = _mutableObjects.triple.copyWith(
    state: newState,
    event: TripleEvent.state,
    isLoading: false,
  );
  candidate = candidate.clearError();
  candidate = middleware(candidate);
  if (force || (candidate.state != _mutableObjects.triple.state)) {
    _mutableObjects.lastState = candidate;
    _mutableObjects.triple = candidate;
    propagate(_mutableObjects.triple);
  }
}