prependOnceListener method

AsyncEventEmitter prependOnceListener(
  1. String event,
  2. Handler listener
)

Adds a one-time listener function for the given event to the beginning of the listeners array. The next time the event is triggered, this listener is removed, and then invoked. @param event The event to prepend the listener to. @param listener The listener to prepend. @returns A reference to the AsyncEventEmitter, so that calls can be chained.

Implementation

AsyncEventEmitter prependOnceListener(
  String event,
  Handler<dynamic> listener,
) {
  final wrappedListener = _createOnceListener(event, listener);
  return prependListener(event, wrappedListener);
}