once method

String once(
  1. String event,
  2. Function function
)

Attaches a one-time event listener.

This method does the same as on except that the event listener will be automatically removed after being invoked — i.e. the listener is invoked at most once.

Implementation

String once(String event, Function function) =>
    _dispatcher.once(event, function);