Package org.brightify.hyperdrive.multiplatformx.property

Types

DeferredObservableProperty
Link copied to clipboard
interface DeferredObservableProperty<T>
This interface is an asynchronous variation to the ObservableProperty.
MutableObservableProperty
Link copied to clipboard
interface MutableObservableProperty<T> : ObservableProperty<T>
ObservableProperty with the added functionality of a mutable value.
ObservableProperty
Link copied to clipboard
interface ObservableProperty<T>
A synchronous property delegate accessor.
ValueChangeListener
Link copied to clipboard
interface ValueChangeListener<OLD, NEW>
Implemented by listeners to observe ObservableProperty and DeferredObservableProperty value changes.
ViewModelProperty
Link copied to clipboard
typealias ViewModelProperty<T> = ObservableProperty<T>

Functions

asChannel
Link copied to clipboard
fun <T> ObservableProperty<T>.asChannel(): Channel<T>
Conversion method to Channel.
asFlow
Link copied to clipboard
fun <T> ObservableProperty<T>.asFlow(): Flow<T>
Conversion method to Flow.
combine
Link copied to clipboard
fun <T> combine(sources: List<ObservableProperty<T>>): ObservableProperty<List<T>>
Combine the last values of all provided ObservableProperty into a list of values.
fun <T1, T2> combine(source1: ObservableProperty<T1>, source2: ObservableProperty<T2>, equalityPolicy: ObservableProperty.EqualityPolicy<Pair<T1, T2>> = defaultEqualityPolicy()): ObservableProperty<Pair<T1, T2>>
Combine the last values of two ObservableProperty into a Pair.
fun <T1, T2, U> combine(source1: ObservableProperty<T1>, source2: ObservableProperty<T2>, equalityPolicy: ObservableProperty.EqualityPolicy<U> = defaultEqualityPolicy(), combine: (T1, T2) -> U): ObservableProperty<U>
Combine the last values of two ObservableProperty with a mapping function.
fun <T1, T2, T3, U> combine(source1: ObservableProperty<T1>, source2: ObservableProperty<T2>, source3: ObservableProperty<T3>, equalityPolicy: ObservableProperty.EqualityPolicy<Triple<T1, T2, T3>> = defaultEqualityPolicy()): ObservableProperty<Triple<T1, T2, T3>>
Combine the last values of three ObservableProperty into a Triple.
fun <T1, T2, T3, U> combine(source1: ObservableProperty<T1>, source2: ObservableProperty<T2>, source3: ObservableProperty<T3>, equalityPolicy: ObservableProperty.EqualityPolicy<U> = defaultEqualityPolicy(), combine: (T1, T2, T3) -> U): ObservableProperty<U>
Combine the last values of three ObservableProperty with a mapping function.
fun <T1, T2, T3, T4, U> combine(source1: ObservableProperty<T1>, source2: ObservableProperty<T2>, source3: ObservableProperty<T3>, source4: ObservableProperty<T4>, equalityPolicy: ObservableProperty.EqualityPolicy<U> = defaultEqualityPolicy(), combine: (T1, T2, T3, T4) -> U): ObservableProperty<U>
Combine the last values of four ObservableProperty with a mapping function.
fun <T1, T2, T3, T4, T5, U> combine(source1: ObservableProperty<T1>, source2: ObservableProperty<T2>, source3: ObservableProperty<T3>, source4: ObservableProperty<T4>, source5: ObservableProperty<T5>, equalityPolicy: ObservableProperty.EqualityPolicy<U> = defaultEqualityPolicy(), combine: (T1, T2, T3, T4, T5) -> U): ObservableProperty<U>
Combine the last values of five ObservableProperty with a mapping function.
constant
Link copied to clipboard
fun <T> ObservableProperty.Companion.constant(value: T): ObservableProperty<T>
defaultEqualityPolicy
Link copied to clipboard
fun <T> defaultEqualityPolicy(): ObservableProperty.EqualityPolicy<T>
Create an equality policy using the default T.
deferred
Link copied to clipboard
fun <T> ObservableProperty<T>.deferred(): DeferredObservableProperty<T>
Conversion method to asynchronous DeferredObservableProperty.
filter
Link copied to clipboard
fun <T> ObservableProperty<T>.filter(equalityPolicy: ObservableProperty.EqualityPolicy<T> = defaultEqualityPolicy(), predicate: (T) -> Boolean): DeferredObservableProperty<T>
A filter function applied to each element collected from the ObservableProperty.
fun <T> ObservableProperty<T>.filter(initialValue: T, equalityPolicy: ObservableProperty.EqualityPolicy<T> = defaultEqualityPolicy(), predicate: (T) -> Boolean): ObservableProperty<T>
A filter function applied to each element collected from the ObservableProperty.
filterNotNull
Link copied to clipboard
fun <T : Any> ObservableProperty<T?>.filterNotNull(equalityPolicy: ObservableProperty.EqualityPolicy<T> = defaultEqualityPolicy()): DeferredObservableProperty<T>
Keep each non-null element collected from the ObservableProperty.
flatMapLatest
Link copied to clipboard
fun <T, U> DeferredObservableProperty<T>.flatMapLatest(equalityPolicy: ObservableProperty.EqualityPolicy<DeferredObservableProperty<U>> = identityEqualityPolicy(), transform: (T) -> DeferredObservableProperty<U>): DeferredObservableProperty<U>
A mapping function applied to each element collected from the ObsrvableProperty to return a DeferredObservableProperty.
fun <T, U> ObservableProperty<T>.flatMapLatest(equalityPolicy: ObservableProperty.EqualityPolicy<ObservableProperty<U>> = identityEqualityPolicy(), transform: (T) -> ObservableProperty<U>): ObservableProperty<U>
A mapping function applied to each element collected from the ObservableProperty to return another ObservableProperty.
identityEqualityPolicy
Link copied to clipboard
fun <T> identityEqualityPolicy(): ObservableProperty.EqualityPolicy<T>
Create an equality policy that returns true only if the values are identical, not just equal.
map
Link copied to clipboard
fun <T, U> DeferredObservableProperty<T>.map(equalityPolicy: ObservableProperty.EqualityPolicy<U> = defaultEqualityPolicy(), transform: (T) -> U): DeferredObservableProperty<U>
A mapping function applied to each element collected from the DeferredObservableProperty.
fun <T, U> ObservableProperty<T>.map(equalityPolicy: ObservableProperty.EqualityPolicy<U> = defaultEqualityPolicy(), transform: (T) -> U): ObservableProperty<U>
A mapping function applied to each element collected from the ObservableProperty.
merge
Link copied to clipboard
fun <T> merge(sources: List<ObservableProperty<T>>): DeferredObservableProperty<T>
mergeDeferred
Link copied to clipboard
fun <T> mergeDeferred(sources: List<DeferredObservableProperty<T>>): DeferredObservableProperty<T>
MutableObservableProperty
Link copied to clipboard
fun <T> MutableObservableProperty(initialValue: T, equalityPolicy: ObservableProperty.EqualityPolicy<T> = defaultEqualityPolicy()): MutableObservableProperty<T>
never
Link copied to clipboard
fun <T> ObservableProperty.Companion.never(): DeferredObservableProperty<T>
neverEqualPolicy
Link copied to clipboard
fun <T> neverEqualPolicy(): ObservableProperty.EqualityPolicy<T>
Create an equality policy that always returns false (values are never equal).
nextValue
Link copied to clipboard
suspend fun <T> ObservableProperty<T>.nextValue(): T
Block current thread in wait for the next value change.
startWith
Link copied to clipboard
fun <T> DeferredObservableProperty<T>.startWith(initialValue: T): ObservableProperty<T>
Conversion method to synchronous ObservableProperty.