EventEmitterImpl

The 'Main' implementation of EventEmitter. Most Components should use this, as should RegisteringEventEmitter.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open fun disable()
Disables listener registration and event emitting.
Link copied to clipboard
open fun emit(eventType: String)
Emits an event.
open fun emit(eventType: String, properties: Map<String, Any>)
Emits an event, passing along the properties map
Link copied to clipboard
open fun emitNow(eventType: String, properties: Map<String, Any>)
Emits an event immediately instead of waiting for the handler.
Link copied to clipboard
open fun enable()
Enables listener registration and event emitting.
Link copied to clipboard
open fun off()
Removes all listeners.
open fun off(eventType: String, token: Int)
Removes a listener from an event queue, using the token as a reference
Link copied to clipboard
open fun on(eventType: String, listener: EventListener): Int
Adds the listener to the event queue, returns a token that the caller can use to off itself.
Link copied to clipboard
open fun once(eventType: String, listener: EventListener): Int
Similar to on, except that the listener is removed after processing one event.
Link copied to clipboard
open fun request(eventType: String, listener: EventListener)
Attaches a listener and fires off an event of eventType, with the hope that there's a corresponding listener set to 'respond' to the listener specified in the request.
open fun request(eventType: String, properties: Map<String, Any>, listener: EventListener)
Similar to above, except the properties map is passed along
Link copied to clipboard
open fun respond(event: Event)
Convenience method to save the user from typing event.
open fun respond(properties: Map<String, Any>)
Meant to respond to a request event.