subscribe<K, P> method

void subscribe<K, P>(
  1. K event,
  2. P fn
)

Implementation

void subscribe<K, P>(K event, P fn) {
  final eventKey = event.toString();

  if (_subscribedMap.containsKey(eventKey)) {
    logger.w('⚠️ Overriding existing event handler');
  }

  _subscribedMap[eventKey] = fn;
}