updateEventStateHistory method

  1. @protected
void updateEventStateHistory(
  1. E event,
  2. S nextState
)

Updates the event-state history. The event-state history is used to determine the event related to a given state.

Implementation

@protected
void updateEventStateHistory(E event, S nextState) {
  if (enableForceBuildEvents) {
    if (eventStateHistory.length > eventStateHistorySize) {
      // Limit the event-state history map size
      final oldestEvent = eventStateHistory.keys.first;
      eventStateHistory.remove(oldestEvent);
    }

    if (eventStateHistorySize > 0) {
      // Update the event-state history
      final eventHistory = (eventStateHistory[event] ?? [])
        ..add(nextState.uuid);

      eventStateHistory[event] = eventHistory;
    }
  }
}