RawReactive

class RawReactive<T>(start: ReactiveState<T> = ReactiveState.notReady) : BaseReactive<T> (source)

A reactive value that exposes its state and allows direct mutation. Used for low-level reactive state management.

Constructors

Link copied to clipboard
constructor(start: ReactiveState<T> = ReactiveState.notReady)

Properties

Link copied to clipboard
open override var state: ReactiveState<T>
Link copied to clipboard

Functions

Link copied to clipboard
fun Listenable.addAndRunListener(listener: () -> Unit): () -> Unit

Adds a listener and immediately runs it once.

Link copied to clipboard
abstract fun addListener(listener: () -> Unit): () -> Unit

Adds the listener to be called every time this event fires.

Link copied to clipboard
suspend fun <T> Reactive<T>.await(): T
Link copied to clipboard
suspend fun <T : Any> Reactive<T?>.awaitNotNull(): T
Link copied to clipboard
suspend fun <T> Reactive<T>.awaitOnce(): T
Link copied to clipboard
open override fun beginUse(): () -> Unit

Begins using the resource. Returns a function to stop using the resource.

Link copied to clipboard
Link copied to clipboard
inline suspend fun <T> Reactive<T>.exception(): Exception?
Link copied to clipboard
Link copied to clipboard
inline suspend operator fun <T> Reactive<T>.invoke(): T
Link copied to clipboard
fun <T, L> Reactive<T>.lens(get: (T) -> L): Reactive<L>
Link copied to clipboard
fun <T> Listenable.lensListenable(get: () -> T): Reactive<T>
Link copied to clipboard
fun <T> Reactive<T>.onNextSuccess(action: (T) -> Unit): () -> Unit
Link copied to clipboard
operator fun Listenable.plus(other: Listenable): Listenable
Link copied to clipboard
suspend fun <T> Reactive<T>.state(): ReactiveState<T>
suspend fun <T, V> Reactive<T>.state(get: (ReactiveState<T>) -> V): V
Link copied to clipboard
fun <T> Reactive<T>.validated(validate: (T) -> Issue?): Validated<T>
Link copied to clipboard
fun <T> Reactive<T>.withWrite(action: suspend Reactive<T>.(T) -> Unit): MutableReactive<T>