MapEventsObservable

public protocol MapEventsObservable : AnyObject

Undocumented

  • Listen to multiple occurrences of a Map event.

    Declaration

    Swift

    @discardableResult
    func onEvery(_ eventType: MapEvents.EventKind, handler: @escaping (Event) -> Void) -> Cancelable

    Parameters

    eventType

    The event type to listen to.

    handler

    The closure to execute when the event occurs.

    Return Value

    A Cancelable object that you can use to stop listening for events. This is especially important if you have a retain cycle in the handler.

  • Listen to a single occurrence of a Map event.

    This will observe the next (and only the next) event of the specified type. After observation, the underlying subscriber will unsubscribe from the map or snapshotter.

    If you need to unsubscribe before the event fires, call cancel() on the returned Cancelable object.

    Declaration

    Swift

    @discardableResult
    func onNext(_ eventType: MapEvents.EventKind, handler: @escaping (Event) -> Void) -> Cancelable

    Parameters

    eventType

    The event type to listen to.

    handler

    The closure to execute when the event occurs.

    Return Value

    A Cancelable object that you can use to stop listening for the event. This is especially important if you have a retain cycle in the handler.