once method

MapboxMap once(
  1. String type,
  2. Listener listener
)

Adds a listener that will be called only once to a specified event type.

The listener will be called first time the event fires after the listener is registered.

@param {string} type The event type to listen for. @param {Function} listener The function to be called when the event is fired the first time. @returns {Object} this

Implementation

MapboxMap once(String type, Listener listener) =>
    MapboxMap.fromJsObject(jsObject.once(type, allowInterop(
      (EventJsImpl object) {
        listener(Event.fromJsObject(object));
      },
    )));