dispatch method

void dispatch(
  1. T event, {
  2. dynamic data,
})

发送事件

Implementation

void dispatch(T event, {dynamic data}) {
  if (_eventActionSubject.isClosed) {
    RxLogger.warning('Cannot dispatch event after dispose: $event');
    return;
  }

  try {
    _eventActionSubject.safeAdd(
      EventAction(
        event,
        data: data,
      ),
    );
  } catch (error, stackTrace) {
    RxLogger.logError(error, stackTrace);
  }
}