Package-level declarations

Types

Link copied to clipboard

An abstract class extending BaseSubject that implements DefaultSubject.

Link copied to clipboard
Link copied to clipboard
abstract class AbstractBaseSubject<R : T, T, OO : ObservableOptional<R>>(observation: Observation<R, T, OO>, stateFlowToBind: suspend () -> StateFlow<R?>) : BaseObservable<R, T, OO> , BasicSubject<R, T, OO>

An abstract class extending BaseObservable that is a BasicSubject.

Link copied to clipboard
Link copied to clipboard

An abstract class extending BaseObservable that implements DefaultObservable

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

An abstract class extending AbstractBaseDefaultSubject.

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

An abstract class extending AbstractBaseDefaultSubject.

actual abstract class BaseDefaultSubject<R : T?, T>

An abstract class extending AbstractBaseDefaultSubject.

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

An abstract class extending AbstractBaseDefaultSubject.

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

An abstract class extending AbstractBaseDefaultSubject.

Link copied to clipboard

Abstract class implementing AbstractBaseInitializedSubject

Abstract class implementing AbstractBaseInitializedSubject

actual abstract class BaseInitializedSubject<T>

Abstract class implementing AbstractBaseInitializedSubject

Abstract class implementing AbstractBaseInitializedSubject

Abstract class implementing AbstractBaseInitializedSubject

Link copied to clipboard
abstract class BaseObservable<R : T, T, OO : ObservableOptional<R>>(observation: Observation<R, T, OO>) : BasicObservable<R, T, OO> , Initial<R, T>

An observable value.

Link copied to clipboard
abstract class BaseSimpleDisposable(onDispose: DisposeHandler) : SynchronizedObject, Disposable

Plain Disposable to an object that should be disposed in time

Link copied to clipboard
actual abstract class BaseSubject<R : T, T, OO : ObservableOptional<R>>(observation: Observation<R, T, OO>, stateFlowToBind: suspend () -> StateFlow<R?>) : AbstractBaseSubject<R, T, OO>

An abstract class that extends AbstractBaseSubject.

expect abstract class BaseSubject<R : T, T, OO : ObservableOptional<R>>(observation: Observation<R, T, OO>, stateFlowToBind: suspend () -> StateFlow<R?>) : AbstractBaseSubject<R, T, OO>

An abstract class that extends AbstractBaseSubject.

actual abstract class BaseSubject<R : T, T, OO : ObservableOptional<R>>

An abstract class that extends AbstractBaseSubject.

actual abstract class BaseSubject<R : T, T, OO : ObservableOptional<R>>(observation: Observation<R, T, OO>, stateFlowToBind: suspend () -> StateFlow<R?>) : AbstractBaseSubject<R, T, OO>

An abstract class that extends AbstractBaseSubject.

actual abstract class BaseSubject<R : T, T, OO : ObservableOptional<R>>(observation: Observation<R, T, OO>, stateFlowToBind: suspend () -> StateFlow<R?>) : AbstractBaseSubject<R, T, OO>

An abstract class that extends AbstractBaseSubject.

Link copied to clipboard
Link copied to clipboard
actual abstract class BaseUninitializedSubject<T>

An abstract class extending AbstractBaseUninitializedSubject.

Link copied to clipboard

A read-only property that can be observed.

Link copied to clipboard

A read-write property that can be observed. The value that can be changed using the post method from the Postable interface

Link copied to clipboard
class DefaultFlowObservable<R : T?, T>(defaultValue: R, initialValue: T? = defaultValue, coroutineScope: CoroutineScope, context: CoroutineContext = coroutineScope.coroutineContext, flow: Flow<T?>, observation: ObservationDefault<R, T?> = ObservationDefault( defaultValue, ObservableOptional.Value(initialValue), )) : BaseDefaultObservable<R, T?>

A BaseDefaultObservable that observes the state of a Flow.

Link copied to clipboard
interface DefaultInitialized<R : T?, T> : Initialized<R, T?>
Link copied to clipboard
interface Disposable

Reference to an object that should be disposed in time

Link copied to clipboard

Container for multiple Disposable. Allows nested DisposeBag.

Link copied to clipboard
typealias DisposeHandler = () -> Unit
Link copied to clipboard
class FlowInitializedObservable<T>(initialValue: T, val coroutineScope: CoroutineScope, context: CoroutineContext = coroutineScope.coroutineContext, val flow: Flow<T>, observation: ObservationInitialized<T> = ObservationInitialized(initialValue)) : BaseInitializedObservable<T>

A BaseInitializedObservable that observes the state of a Flow

Link copied to clipboard
class FlowObservable<T>(val coroutineScope: CoroutineScope, context: CoroutineContext = coroutineScope.coroutineContext, val flow: Flow<T>, observation: ObservationUninitialized<T> = ObservationUninitialized()) : BaseUninitializedObservable<T>

A BaseUninitializedObservable that observes the state of a Flow

Link copied to clipboard
interface Initial<R : T, T>

Marks a class that has an initial ObservableOptional value, where T is the expected input value and R is its result.

Link copied to clipboard
interface Initialized<R : T, T> : Initial<R, T> , WithState<R>

An Initial that has Value as its initialValue

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Result type for a BaseObservable. Used to allow for the distinction between null and optional values.

Link copied to clipboard
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

Link copied to clipboard
Link copied to clipboard
actual interface PlatformSubjectObserver<R>
expect interface PlatformSubjectObserver<R>
actual interface PlatformSubjectObserver<R>
actual interface PlatformSubjectObserver<R>
actual interface PlatformSubjectObserver<R>
Link copied to clipboard
interface Postable<T>

A Postable can handle values being posted to it.

Link copied to clipboard
class ReadOnlyPropertyDefaultObservable<R : T?, T>(defaultValue: R, readOnlyProperty: ReadOnlyProperty<Any?, T>, observation: ObservationDefault<R, T?> = ObservationDefault( defaultValue, ObservableOptional.Value( run { val v by readOnlyProperty v }, ), )) : BaseDefaultObservable<R, T>

A BaseDefaultObservable that matches its value to a ReadOnlyProperty. When the ReadOnlyProperty updates, changes to the property are not immediately delegated back to the observable. Use a Flow based observable if synchronized values are required

Link copied to clipboard
class ReadOnlyPropertyInitializedObservable<T>(readOnlyProperty: ReadOnlyProperty<Any?, T>, observation: ObservationInitialized<T> = ObservationInitialized( ObservableOptional.Value( run { val v by readOnlyProperty v }, ), )) : BaseInitializedObservable<T> , InitializedObservable<T>

A BaseInitializedObservable that matches its value to a ReadOnlyProperty. When the ReadOnlyProperty updates, changes to the property are not immediately delegated back to the observable. Use a Flow based observable if synchronized values are required.

Link copied to clipboard
class ReadWritePropertyDefaultSubject<R : T?, T>(defaultValue: R, readWriteProperty: ReadWriteProperty<Any?, T?>, initialValue: ObservableOptional.Value<T?> = Value( run { val v by readWriteProperty v }, ), coroutineScope: CoroutineScope?, context: CoroutineContext? = coroutineScope?.coroutineContext, observation: ObservationDefault<R, T?> = ObservationDefault(defaultValue, initialValue)) : BaseDefaultSubject<R, T> , SuspendableSetter<T?>

A BaseDefaultSubject that matches its value to a ReadWriteProperty. When the ReadWriteProperty updates, changes to the property are not immediately delegated back to the subject. Use a Flow based subject if synchronized values are required

Link copied to clipboard
class ReadWritePropertyInitializedSubject<T>(readWriteProperty: ReadWriteProperty<Any?, T>, initialValue: ObservableOptional.Value<T> = Value( run { val v by readWriteProperty v }, ), coroutineScope: CoroutineScope?, context: CoroutineContext? = coroutineScope?.coroutineContext, observation: ObservationInitialized<T> = ObservationInitialized(initialValue)) : BaseInitializedSubject<T> , SuspendableSetter<T>

A BaseInitializedSubject that matches its value to a ReadWriteProperty. When the ReadWriteProperty updates, changes to the property are not immediately delegated back to the subject. Use a Flow based subject if synchronized values are required

Link copied to clipboard
open class SharedFlowDefaultSubject<R : T?, T>(defaultValue: R, initialValue: T? = defaultValue, coroutineScope: CoroutineScope, context: CoroutineContext = coroutineScope.coroutineContext, sharedFlow: MutableSharedFlow<T?>, autoBind: Boolean = true, observation: ObservationDefault<R, T?> = ObservationDefault( defaultValue, ObservableOptional.Value(initialValue), )) : BaseDefaultSubject<R, T?> , SuspendableSetter<T?>

A BaseDefaultSubject that matches the state of a MutableSharedFlow.

Link copied to clipboard
open class SharedFlowInitializedSubject<T>(initialValue: T, coroutineScope: CoroutineScope, context: CoroutineContext = coroutineScope.coroutineContext, sharedFlow: MutableSharedFlow<T>, autoBind: Boolean = true, observation: ObservationInitialized<T> = ObservationInitialized(initialValue)) : BaseInitializedSubject<T> , SuspendableSetter<T>

A BaseInitializedSubject that matches the state of a MutableSharedFlow.

Link copied to clipboard
open class SharedFlowSubject<T>(coroutineScope: CoroutineScope, context: CoroutineContext = coroutineScope.coroutineContext, sharedFlow: MutableSharedFlow<T>, autoBind: Boolean = true, observation: ObservationUninitialized<T> = ObservationUninitialized()) : BaseUninitializedSubject<T> , SuspendableSetter<T>

A BaseUninitializedSubject that matches the state of a MutableSharedFlow.

Link copied to clipboard
class SimpleDefaultSubject<R : T?, T>(defaultValue: R, initialValue: T? = defaultValue) : BaseDefaultSubject<R, T?>

A BaseDefaultSubject that initialized to a given value.

Link copied to clipboard
actual class SimpleDisposable

A Disposable that has a DisposeHandler

Link copied to clipboard
Link copied to clipboard

A BaseInitializedSubject that initialized to a given value.

Link copied to clipboard
open class StateFlowDefaultSubject<R : T?, T>(defaultValue: R, val coroutineScope: CoroutineScope, val context: CoroutineContext = coroutineScope.coroutineContext, observedStateFlow: MutableStateFlow<T?>, autoBind: Boolean = true, observation: ObservationDefault<R, T?> = ObservationDefault( defaultValue, ObservableOptional.Value(observedStateFlow.value), )) : BaseDefaultSubject<R, T?> , SuspendableSetter<T?>

A BaseDefaultSubject that matches the state of a MutableStateFlow.

Link copied to clipboard
open class StateFlowInitializedSubject<T>(val coroutineScope: CoroutineScope, val context: CoroutineContext = coroutineScope.coroutineContext, observedStateFlow: MutableStateFlow<T>, autoBind: Boolean = true, observation: ObservationInitialized<T> = ObservationInitialized( ObservableOptional.Value( observedStateFlow.value, ), )) : BaseInitializedSubject<T> , SuspendableSetter<T>

A BaseInitializedSubject that matches the state of a MutableStateFlow.

Link copied to clipboard
interface SuspendableSetter<T> : Postable<T>

A Postable that can be set in a suspended manner.

Link copied to clipboard
interface Uninitialized<T> : Initial<T, T> , WithState<T?>

An Initial that has Nothing as its initialValue

Link copied to clipboard
interface WithMutableState<T> : WithState<T>

A WithState where stateFlow is mutable

Link copied to clipboard
actual interface WithState<T>

Interface indicating an observable has a state of T

expect interface WithState<T>

Interface indicating an observable has a state of T

actual interface WithState<T>

Interface indicating an observable has a state of T

actual interface WithState<T>

Interface indicating an observable has a state of T

actual interface WithState<T>

Interface indicating an observable has a state of T

Properties

Link copied to clipboard

The Observer that observes the observable value.

Functions

Link copied to clipboard

Casts an ObservableOptional to an ObservableOptional its subtype R or returns defaultValue if no such casting is possible.

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
Link copied to clipboard
fun <R : T, T, OO : ObservableOptional<R>> observeFlow(observation: Observation<R, T, OO>, coroutineScope: CoroutineScope, context: CoroutineContext = coroutineScope.coroutineContext, flow: Flow<T>)

Observes a Flow and sets updates value to an Observation while it is being observed

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> LiveData<T>.observeOnCoroutine(coroutineScope: CoroutineScope, observer: Observer<T>)

Observes LiveData using an Observer on a CoroutineScope

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
inline fun <R : T, T> ObservableOptional<T>.resultValueOrDefault(defaultValue: R): R

Casts the value of an ObservableOptional to its subtype R or returns defaultValue if no such casting is possible.

Link copied to clipboard
fun <T> subjectOf(initialValue: T): SimpleInitializedSubject<T>

Creates a SimpleInitializedSubject with an initial value

Link copied to clipboard
fun <R : T, T> Flow<T?>.toDefaultObservable(defaultValue: R, initialValue: T? = defaultValue, coroutineScope: CoroutineScope, context: CoroutineContext = coroutineScope.coroutineContext): DefaultFlowObservable<R, T>

Converts a Flow into a DefaultFlowObservable

Link copied to clipboard
fun <R : T, T> ReadWriteProperty<Any?, T?>.toDefaultSubject(defaultValue: R, coroutineScope: CoroutineScope? = null, context: CoroutineContext? = coroutineScope?.coroutineContext): ReadWritePropertyDefaultSubject<R, T?>
fun <R : T, T> MutableStateFlow<T?>.toDefaultSubject(defaultValue: R, coroutineScope: CoroutineScope, context: CoroutineContext = coroutineScope.coroutineContext): StateFlowDefaultSubject<R, T>

Converts a MutableStateFlow to a StateFlowDefaultSubject

fun <R : T?, T> MutableSharedFlow<T?>.toDefaultSubject(defaultValue: R, initialValue: T? = defaultValue, coroutineScope: CoroutineScope, context: CoroutineContext = coroutineScope.coroutineContext): SharedFlowDefaultSubject<R, T?>

Converts a MutableSharedFlow to a SharedFlowDefaultSubject

Link copied to clipboard
fun <T> MutableStateFlow<T>.toInitializedObservable(coroutineScope: CoroutineScope, context: CoroutineContext = coroutineScope.coroutineContext): FlowInitializedObservable<T>

Converts a MutableStateFlow into a FlowInitializedObservable

fun <T> Flow<T>.toInitializedObservable(initialValue: T, coroutineScope: CoroutineScope, context: CoroutineContext = coroutineScope.coroutineContext): FlowInitializedObservable<T>

Converts a Flow into a FlowInitializedObservable

Link copied to clipboard
fun <T> ReadWriteProperty<Any?, T>.toInitializedSubject(coroutineScope: CoroutineScope? = null, context: CoroutineContext? = coroutineScope?.coroutineContext): ReadWritePropertyInitializedSubject<T>
fun <T> MutableStateFlow<T>.toInitializedSubject(coroutineScope: CoroutineScope, context: CoroutineContext = coroutineScope.coroutineContext): StateFlowInitializedSubject<T>

Converts a MutableStateFlow to a StateFlowInitializedSubject

fun <T> MutableSharedFlow<T>.toInitializedSubject(initialValue: T, coroutineScope: CoroutineScope, context: CoroutineContext = coroutineScope.coroutineContext): SharedFlowInitializedSubject<T>

Converts a MutableSharedFlow to a SharedFlowInitializedSubject

Link copied to clipboard
fun <T> Flow<T>.toUninitializedObservable(coroutineScope: CoroutineScope, context: CoroutineContext = coroutineScope.coroutineContext): FlowObservable<T>

Converts a Flow into a FlowObservable

Link copied to clipboard
fun <T> MutableSharedFlow<T>.toUninitializedSubject(coroutineScope: CoroutineScope, context: CoroutineContext = coroutineScope.coroutineContext): SharedFlowSubject<T>

Converts a MutableSharedFlow to a SharedFlowSubject