BaseSubject

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.

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.

observation

The Observation to handle observing the value.

stateFlowToBind

A function to get the StateFlow that will automatically call SuspendableSetter.set when a new value is posted after BasicSubject.post has been called.

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.

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.

observation

The Observation to handle observing the value.

stateFlowToBind

A function to get the StateFlow that will automatically call SuspendableSetter.set when a new value is posted after BasicSubject.post has been called.

Inheritors

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

An abstract class that extends AbstractBaseSubject.

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.

observation

The Observation to handle observing the value.

stateFlowToBind

A function to get the StateFlow that will automatically call SuspendableSetter.set when a new value is posted after BasicSubject.post has been called.

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.

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.

observation

The Observation to handle observing the value.

stateFlowToBind

A function to get the StateFlow that will automatically call SuspendableSetter.set when a new value is posted after BasicSubject.post has been called.

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.

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.

observation

The Observation to handle observing the value.

stateFlowToBind

A function to get the StateFlow that will automatically call SuspendableSetter.set when a new value is posted after BasicSubject.post has been called.

Constructors

Link copied to clipboard
actual constructor(observation: Observation<R, T, OO>, stateFlowToBind: suspend () -> StateFlow<R?>)
expect constructor(observation: Observation<R, T, OO>, stateFlowToBind: suspend () -> StateFlow<R?>)
actual constructor(observation: Observation<R, T, OO>, stateFlowToBind: suspend () -> StateFlow<R?>)
actual constructor(observation: Observation<R, T, OO>, stateFlowToBind: suspend () -> StateFlow<R?>)

Properties

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

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
open override val initialValue: ObservableOptional<T>

The initial ObservableOptional value of T.

open override val initialValue: ObservableOptional<T>

The initial ObservableOptional value of T.

open override val initialValue: ObservableOptional<T>

The initial ObservableOptional value of T.

open override val initialValue: ObservableOptional<T>

The initial ObservableOptional value of T.

Link copied to clipboard

The Observer that observes the observable value.

Link copied to clipboard

The MutableLiveData synchronizing the value of the subject.

Functions

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

Bind changes in value to a CoroutineScope in a CoroutineContext

expect 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

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

getValue
Link copied to clipboard
abstract operator fun getValue(thisRef: Any?, property: KProperty<*>): OO
abstract operator fun getValue(thisRef: Any?, property: KProperty<*>): OO
abstract operator fun getValue(thisRef: Any?, property: KProperty<*>): OO
abstract operator fun getValue(thisRef: Any?, property: KProperty<*>): OO
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

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

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
abstract fun post(newValue: T)

Updates the value of this Postable

abstract fun post(newValue: T)

Updates the value of this Postable

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.

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.

abstract suspend fun set(newValue: T)

Updates the value of this Postable in a suspended manner.