Listener

class Listener(val listeners: MutableList<() -> Any>, val listener: () -> Unit) : Settings.Listener

A handle to a listener instance returned by one of the addListener methods of ObservableSettings, so it can be deactivated as needed.

In the CommonMapSettings implementation this simply wraps a lambda parameter which is being called whenever a mutating API is called. Unlike platform implementations, this listener will NOT be called if the underlying map is mutated by something other than the MapSettings instance that originally created the listener.

Constructors

Link copied to clipboard
internal constructor(listeners: MutableList<() -> Any>, listener: () -> Unit)

Properties

Link copied to clipboard
private val listener: () -> Unit
Link copied to clipboard
private val listeners: MutableList<() -> Any>

Functions

Link copied to clipboard
open override fun deactivate()

Unsubscribes this Listener from receiving updates to the value at the key it monitors. After calling this method you should no longer hold a reference to the listener.

Link copied to clipboard
open override fun onRemoveExpiredKeys()