Skip to main content

Module event_emitter

Module event_emitter 

Source
Expand description

Callback-based event subscription for MapState.

Complements the existing poll-based InteractionManager::drain_events model with a subscribe/unsubscribe API that mirrors map.on(type, listener) / map.off(type, listener) from MapLibre GL JS.

§Thread safety

EventEmitter is Send + Sync because callbacks are stored as Box<dyn Fn(&InteractionEvent) + Send + Sync>. The emitter is designed to be called from the same thread that owns MapState (the update path), so no internal locking is required.

Structs§

EventEmitter
Callback-based event subscription system.
ListenerId
Opaque handle returned by EventEmitter::on and EventEmitter::once.