Observation

open class Observation<R : T, T, OO : ObservableOptional<R>>(val initialValue: ObservableOptional<T>) : Initial<R, T>

Class that handles observing value changes for a value of a given type

Parameters

T

the type of value to expect.

R

the type of result to expect. Must be a subclass of T.

OO

the type of ObservableOptional to store the result in.

initialValue

The initial value this observation should contain.

Inheritors

Constructors

Link copied to clipboard
constructor(initialValue: ObservableOptional<T>)

Properties

Link copied to clipboard

Transformation to apply to the latest value when observedValue is called.

Link copied to clipboard

The currently observed OO

Link copied to clipboard
open override val currentOrNull: R?

The current value T or null being observed

Link copied to clipboard

The default ObservableOptional.Value to return if the current value is ObservableOptional.Nothing or ObservableOptional.Value containing null.

Link copied to clipboard
open override val initialValue: ObservableOptional<T>
Link copied to clipboard

The ObservableOptional or T that is currently being observed.

Link copied to clipboard

Action to execute when this observable is observed for the first time.

Functions

Link copied to clipboard
open override fun observe(onNext: (R?) -> Unit): Disposable

Adds an observing function to the Observable to be notified on each change to the observable. If there is a current value, there will be an immediate notification

Link copied to clipboard

set the value of this Observable from a suspended context.