emitAsync method
Trigger eventName
event with or without the param
given as async way.
Implementation
Future<void> emitAsync(
Object? instance,
Enum eventName, [
dynamic param,
]) async {
final callbacks = {
...?_events[_getEventKey(instance, eventName)],
...?_events["${instance.hashCode}.${eventName.hashCode}"],
};
await Future.wait(
callbacks.map(
(callback) => Future.microtask(
() => callback(_getInstance(instance), param),
),
),
);
}