once method

dynamic once(
  1. dynamic event,
  2. Function listener
)

Add a listener to be triggered for only the next event, at which time it will be removed.

Implementation

once(dynamic event, Function listener) => callMethod(impl, 'once',
    [event is EventFilter ? event.impl : event, allowInterop(listener)]);