emit method

void emit(
  1. Enum eventName, [
  2. dynamic param
])

Trigger eventName event with or without the param given.

Implementation

void emit(Enum eventName, [dynamic param]) {
  final callbacks = HashSet()
    ..addAll(
      _events[_instance]?[eventName] ?? {},
    )
    ..addAll(
      _events[_reactterInstance]?[eventName] ?? {},
    );

  for (var callback in callbacks) {
    callback(_instance, param);
  }
}