Package-level declarations

Types

Link copied to clipboard

A type of change in a collection.

Link copied to clipboard

Represents the execution order guarantee of a scheduler.

Link copied to clipboard
interface IAsyncSignal<T> : ISignal<T> , IAsyncSource<T>
Link copied to clipboard
interface IAsyncSource<out T> : ISource<T>

An object that allows to subscribe to events of type T and to handle them on a different thread.

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

A mutable property that is created in an uninitialized state.

Link copied to clipboard
interface IOptPropertyView<out T : Any> : IPropertyBase<T>

A read-only property that is created in an uninitialized state and can be observed.

Link copied to clipboard

A mutable property.

Link copied to clipboard
interface IPropertyBase<out T> : ISource<T> , IViewable<T>

Common base class of optional and non-optional properties. Shouldn't be used in client code.

Link copied to clipboard
interface IPropertyView<out T> : IPropertyBase<T>

A read-only property that can be observed.

Link copied to clipboard
interface IScheduler

Allows to queue the execution of actions on a different thread.

Link copied to clipboard
Link copied to clipboard
interface ISignal<T> : ISource<T>

An object which has a collection of event listeners and can broadcast an event to the listeners.

Link copied to clipboard
interface ISource<out T>

An object that allows to subscribe to events of type T.

Link copied to clipboard
interface IViewable<out T>

An object that allows to subscribe to changes of its contents.

Link copied to clipboard
Link copied to clipboard

A list allowing its contents to be observed.

Link copied to clipboard
interface IViewableMap<K : Any, out V : Any> : Map<K, V> , IViewable<Map.Entry<K, V>> , ISource<IViewableMap.Event<K, V>>

A map allowing its contents to be observed.

Link copied to clipboard

A set allowing its contents to be observed.

Link copied to clipboard
typealias IVoidSignal = ISignal<Unit>
Link copied to clipboard
typealias IVoidSource = ISource<Unit>
Link copied to clipboard
data class KeyValuePair<K, V>(val key: K, val value: V) : Map.Entry<K, V>
Link copied to clipboard
open class OptProperty<T : Any> : IOptProperty<T>
Link copied to clipboard
class Property<T>(defaultValue: T) : IProperty<T>
Link copied to clipboard
class Pump(val pumpAction: () -> Unit, val pumpPauseMs: Long)
Link copied to clipboard
class RdFault(val reasonTypeFqn: String, val reasonMessage: String, val reasonAsText: String, reason: Throwable? = null) : ExecutionException
Link copied to clipboard
open class Signal<T> : ISignal<T>
Link copied to clipboard
class SignalFlow<T>(signal: ISignal<T>) : Flow<T>
Link copied to clipboard
sealed class TaskResult<out T>
Link copied to clipboard
class ViewableList<T : Any>(storage: MutableList<T> = mutableListOf()) : IMutableViewableList<T>
Link copied to clipboard
class ViewableMap<K : Any, V : Any>(map: MutableMap<K, V> = LinkedHashMap()) : IMutableViewableMap<K, V>
Link copied to clipboard
class ViewableSet<T : Any>(set: MutableSet<T> = LinkedHashSet<T>()) : IMutableViewableSet<T>
Link copied to clipboard

Properties

Link copied to clipboard
Link copied to clipboard

Evaluates to true if the property has an initialized value.

Link copied to clipboard

Returns the value of the property, or throws an exception if it was not initialized.

Functions

Link copied to clipboard
fun IVoidSource.advise(lifetime: Lifetime, handler: () -> Unit)
Link copied to clipboard
fun <T> ISource<T>.adviseEternal(handler: (T) -> Unit)

Adds an event subscription that never gets removed.

Link copied to clipboard
fun <T : Any> ISource<T?>.adviseNotNull(lifetime: Lifetime, handler: (T) -> Unit)

Adds an event subscription that filters out null values.

Link copied to clipboard
fun <T : Any> ISource<T?>.adviseNotNullOnce(lifetime: Lifetime, handler: (T) -> Unit): LifetimeDefinition

Executes handler exactly once when the source fires an event with a non-null value, then terminates the subscription

Link copied to clipboard
fun IAsyncSource<Unit>.adviseOn(lifetime: Lifetime, scheduler: IScheduler, handler: () -> Unit)
Link copied to clipboard
fun <T> ISource<T>.adviseOnce(lifetime: Lifetime, handler: (T) -> Unit)

Executes handler exactly once then terminates the subscription

Link copied to clipboard
fun <T> ISource<T>.adviseUntil(lifetime: Lifetime, handler: (T) -> Boolean)

Holds subscription until handler returns true or lifetime is terminated

Link copied to clipboard
fun <T> ISource<T>.adviseWithPrev(lifetime: Lifetime, handler: (prev: Maybe<T>, cur: T) -> Unit)
Link copied to clipboard
Link copied to clipboard

Converts an optional property to a non-optional property with a nullable value type.

Link copied to clipboard
fun <T> IMutablePropertyBase<T>.bind(lifetime: Lifetime, setValue: (value: T) -> Unit, valueUpdated: ((value: T) -> Unit) -> Unit)
Link copied to clipboard
fun <T1, T2, TRes> IPropertyView<T1>.compose(other: IPropertyView<T2>, composer: (T1, T2) -> TRes): IPropertyView<TRes>
Link copied to clipboard
Link copied to clipboard
fun <T> ISource<T>.filter(f: (T) -> Boolean): ISource<T>
Link copied to clipboard
Link copied to clipboard

fun <T> ISource<T>.flowInto(lifetime: Lifetime, target: ISignal<T>)

Whenever a change happens in this source, fires a change in the target signal of the same type.

fun <TSrc, TDst> ISource<TSrc>.flowInto(lifetime: Lifetime, target: IMutablePropertyBase<TDst>, tf: (TSrc) -> TDst)

Whenever a change happens in this source, changes the target property of the same type.

fun <TSource, TTarget> ISource<TSource>.flowInto(lifetime: Lifetime, target: ISignal<TTarget>, tf: (TSource) -> TTarget)

Whenever a change happens in this source, fires a change in the target signal obtained by running the given tf function.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun <T : Any, R : Any> IOptPropertyView<T>.map(f: (T) -> R): IOptPropertyView<R>
fun <T, R> IPropertyView<T>.map(f: (T) -> R): IPropertyView<R>

fun <T, R> ISource<T>.map(f: (T) -> R): ISource<R>

Returns a new source which remaps events happening in this source using the given function f.

Link copied to clipboard
fun <T> IProperty<T?>.setValue(lifetime: Lifetime, value: T?)

Sets the property value to the given value for the duration of the lifetime, and resets it to null when the lifetime is terminated.

Link copied to clipboard
Link copied to clipboard
fun <K : Any, V : Any, T : Any> IMutableViewableMap<K, V>.toViewableList(lifetime: Lifetime, converter: (Lifetime, V) -> T): ViewableList<T>

Converts a viewable map to a viewable list of values, where the converter function is used to convert each map value to a list value.

Link copied to clipboard
fun <T : Any> IOptProperty<T>.valueOrDefault(default: T): T

Returns the value of the property, or the given default value if the property was not initialized.

Link copied to clipboard

Returns a property which evaluates to the last element of the list and is updated as elements are added to the list or removed from it.

Link copied to clipboard
fun <T : Any> IViewable<T?>.viewNotNull(lifetime: Lifetime, handler: (Lifetime, T) -> Unit)

Adds a subscription to changes to this viewable's contents and filters out null values. The subscription is removed when the given lifetime expires.

Link copied to clipboard
fun IViewable<Boolean>.whenFalse(lifetime: Lifetime, action: (Lifetime) -> Unit)

Executes the given action every time the value of the property changes to false.

Link copied to clipboard
fun IViewable<Boolean>.whenTrue(lifetime: Lifetime, action: (Lifetime) -> Unit)

Executes the given action every time the value of the property changes to true.