fire method

  1. @override
void fire(
  1. AppEvent event
)
override

Fire a event

Implementation

@override
void fire(AppEvent event) {
  if (_history.length >= maxHistoryLength) {
    _history.removeAt(0);
  }
  _history.add(EventBusHistoryEntry(event, event.timestamp));
  // 1. Fire the event
  _lastEventSubject.add(event);
  // 2. Map if needed
  _map(event);
  // 3. Reset stream
  _lastEventSubject.add(EmptyEvent());
  if (allowLogging) {
    NyLogger.debug(' ⚡️ [${event.timestamp}] $event');
  }
}