WithState

actual interface WithState<T>

Interface indicating an observable has a state of T

Parameters

T

the type of the state.

expect interface WithState<T>

Interface indicating an observable has a state of T

Parameters

T

the type of the state.

Inheritors

actual interface WithState<T>

Interface indicating an observable has a state of T

Parameters

T

the type of the state.

actual interface WithState<T>

Interface indicating an observable has a state of T

Parameters

T

the type of the state.

actual interface WithState<T>

Interface indicating an observable has a state of T

Parameters

T

the type of the state.

Properties

Link copied to clipboard
open val liveData: LiveData<T>

The LiveData matching stateFlow

Link copied to clipboard
actual abstract val stateFlow: StateFlow<T>

StateFlow that expresses the content from the observable.

expect abstract val stateFlow: StateFlow<T>

StateFlow that expresses the content from the observable.

actual abstract val stateFlow: StateFlow<T>

StateFlow that expresses the content from the observable.

actual abstract val stateFlow: StateFlow<T>

StateFlow that expresses the content from the observable.

actual abstract val stateFlow: StateFlow<T>

StateFlow that expresses the content from the observable.

Link copied to clipboard
actual abstract val valueDelegate: ReadOnlyProperty<Any?, T>

A ReadOnlyProperty of T

Functions

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.