prependListener method

  1. @mustCallSuper
void prependListener(
  1. String eventName,
  2. Function callback, {
  3. bool once = false,
})

Implementation

@mustCallSuper
void prependListener(String eventName, Function callback,
    {bool once = false}) {
  assert(callback != null);
  assert(eventName != null);
  assert(eventName.isNotEmpty);

  if (!_events.containsKey(eventName)) {
    _events[eventName] = <_KuzzleListener>[];
  }

  if (!_exist(eventName, callback)) {
    _events[eventName]!.insert(0, _KuzzleListener(callback, once: once));
  }
}