BaseDefaultSubject

actual abstract class BaseDefaultSubject<R : T?, T>(observation: ObservationDefault<R, T?>) : AbstractBaseDefaultSubject<R, T>

An abstract class extending AbstractBaseDefaultSubject.

Parameters

observation

The ObservationUninitialized to handle value being observed

Type Parameters

T

the type of value to expect.

R

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

expect abstract class BaseDefaultSubject<R : T?, T>(observation: ObservationDefault<R, T?>) : AbstractBaseDefaultSubject<R, T>

An abstract class extending AbstractBaseDefaultSubject.

Parameters

observation

The ObservationUninitialized to handle value being observed

Type Parameters

T

the type of value to expect.

R

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

Inheritors

actual abstract class BaseDefaultSubject<R : T?, T>(observation: ObservationDefault<R, T?>) : AbstractBaseDefaultSubject<R, T>

An abstract class extending AbstractBaseDefaultSubject.

Parameters

observation

The ObservationUninitialized to handle value being observed

Type Parameters

T

the type of value to expect.

R

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

Constructors

Link copied to clipboard
actual constructor(observation: ObservationDefault<R, T?>)
actual constructor(defaultValue: ObservableOptional.Value<R>, initialValue: ObservableOptional.Value<T?>)

Constructor

expect constructor(observation: ObservationDefault<R, T?>)
expect constructor(defaultValue: ObservableOptional.Value<R>, initialValue: ObservableOptional.Value<T?>)

Constructor

actual constructor(observation: ObservationDefault<R, T?>)
actual constructor(defaultValue: ObservableOptional.Value<R>, initialValue: ObservableOptional.Value<T?>)

Constructor

Properties

Link copied to clipboard
open override val current: R

The current value of R

expect open override val current: R

The current value of R

open override val current: R

The current value of R

Link copied to clipboard
open override val currentOrNull: T?

The current value T or null being observed

expect open override val currentOrNull: T?

The current value T or null being observed

open override val currentOrNull: T?

The current value T or null being observed

Link copied to clipboard

The default Value of R. Can be used in case Nothing is Initial.initialValue

expect open override val defaultValue: ObservableOptional.Value<R>

The default Value of R. Can be used in case Nothing is Initial.initialValue

The default Value of R. Can be used in case Nothing is Initial.initialValue

Link copied to clipboard

The initial ObservableOptional value of T.

expect open override val initialValue: ObservableOptional.Value<T?>

The initial ObservableOptional value of T.

The initial ObservableOptional value of T.

Link copied to clipboard
open override val liveData: LiveData<R>

The LiveData matching stateFlow

Link copied to clipboard

The Observer that observes the observable value.

Link copied to clipboard

The MutableLiveData synchronizing the value of the subject.

Link copied to clipboard
open override val stateFlow: MutableStateFlow<R>

MutableStateFlow that expresses the content from the observable.

expect open override val stateFlow: MutableStateFlow<R>

MutableStateFlow that expresses the content from the observable.

open override val stateFlow: MutableStateFlow<R>

MutableStateFlow that expresses the content from the observable.

Link copied to clipboard
expect open override val valueDelegate: ReadWriteProperty<Any?, R>

Functions

Link copied to clipboard
actual override fun bind(coroutineScope: CoroutineScope, context: CoroutineContext)

Bind changes in value to a CoroutineScope in a CoroutineContext

override fun bind(coroutineScope: CoroutineScope, context: CoroutineContext)

Bind changes in value to a CoroutineScope in a CoroutineContext

actual override fun bind(coroutineScope: CoroutineScope, context: CoroutineContext)

Bind changes in value to a CoroutineScope in a CoroutineContext

Link copied to clipboard
fun <R : T, T, OO : ObservableOptional<R>> BasicSubject<R, T, OO>.bind(coroutineScope: CoroutineScope)

Convenience method for BasicSubject that calls BasicSubject.bind using the CoroutineContext of the provided CoroutineScope

Link copied to clipboard
open operator override fun getValue(thisRef: Any?, property: KProperty<*>): ObservableOptional.Value<R>
expect open operator override fun getValue(thisRef: Any?, property: KProperty<*>): ObservableOptional.Value<R>
open operator override fun getValue(thisRef: Any?, property: KProperty<*>): ObservableOptional.Value<R>
Link copied to clipboard

Gets an Observer to observe changes to this subject.

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

Creates an observation that calls onNext each time a new value is observed until the resulting Disposable is disposed

expect open override fun observe(onNext: (R?) -> Unit): Disposable

Creates an observation that calls onNext each time a new value is observed until the resulting Disposable is disposed

open override fun observe(onNext: (R?) -> Unit): Disposable

Creates an observation that calls onNext each time a new value is observed until the resulting Disposable is disposed

Link copied to clipboard
open override fun observeInitialized(onNext: (R) -> Unit): Disposable
expect open override fun observeInitialized(onNext: (R) -> Unit): Disposable
open override fun observeInitialized(onNext: (R) -> Unit): Disposable
Link copied to clipboard
fun <T> WithState<T?>.observeNotNullOnLifecycle(lifecycleOwner: LifecycleOwner, filter: suspend (T) -> Boolean = { true }, onNext: (T) -> Unit): Job

Observes WithState of a nullable value on the lifecycle of a LifecycleOwner

Link copied to clipboard
fun <T> WithState<T>.observeOnLifecycle(lifecycleOwner: LifecycleOwner, filter: suspend (T) -> Boolean = { true }, onNext: (T) -> Unit): Job

Observes WithState on the lifecycle of a LifecycleOwner

fun <T, R> WithState<T>.observeOnLifecycle(lifecycleOwner: LifecycleOwner, filter: suspend (T) -> Boolean = { true }, transform: suspend (T) -> R, onNext: (R) -> Unit): Job

Observes WithState on the lifecycle of a LifecycleOwner by transforming the observed value.

Link copied to clipboard
abstract fun post(newValue: T?)

Updates the value of this Postable

expect abstract fun post(newValue: T?)

Updates the value of this Postable

abstract fun post(newValue: T?)

Updates the value of this Postable

Link copied to clipboard
abstract suspend fun set(newValue: T?)

Updates the value of this Postable in a suspended manner.

expect abstract suspend fun set(newValue: T?)

Updates the value of this Postable in a suspended manner.

abstract suspend fun set(newValue: T?)

Updates the value of this Postable in a suspended manner.