Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
class Emitter<TType>

https://in-kotlin.com/design-patterns/observer/

Link copied to clipboard
open class Observable<T> : ObservableIfc<T>

The Java observer/observable pattern has a number of flaws. This class provides a base implementation of the observer/observable pattern that mitigates those flaws. This allows observers to be added and called in the order added to the component. The basic usage of this class is to have a class have an instance of Observable while implementing the ObservableIfc. The notifyObservers() method can be used to notify attached observers whenever necessary.

Link copied to clipboard

Permits observable pattern to be used in delegation pattern by exposing notification of observers via public method.

Link copied to clipboard
interface ObservableIfc<T>

The Java Observer/Observable implementation has a number of flaws. This class represents an interface for objects that can be observed. Essentially, observable objects promise the basic management of classes that implement the ObserverIfc

Link copied to clipboard
class ObservableValue<T>(initialValue: T) : Observable<T>

Another way to implement observable delegation. When the observed value property is changed, observers are notified.

Link copied to clipboard
interface ObserverIfc<T>

This interface works with observers as a call back function for when the observable needs observing

Functions

Link copied to clipboard
fun main()
Link copied to clipboard
fun <T> Observable<T>.observe(block: (T?) -> Unit)