Events

class Events

Constructors

Link copied to clipboard
fun Events()

Functions

Link copied to clipboard
fun <T> raise(definition: EventDefinition<T>, value: T)

Raises the event specified by definition with the value and calls all handlers.

Link copied to clipboard
fun <T> subscribe(definition: EventDefinition<T>, handler: EventHandler<T>): DisposableHandle

Subscribe handler to an event specified by definition

Link copied to clipboard
fun <T> unsubscribe(definition: EventDefinition<T>, handler: EventHandler<T>)

Unsubscribe handler from an event specified by definition

Extensions

Link copied to clipboard
fun <T> Events.raiseCatching(definition: EventDefinition<T>, value: T, logger: Logger? = null)

Raises an event the same way as Events.raise but catches an exception and logs it if the logger is provided