Package-level declarations

Types

Link copied to clipboard
abstract class BaseListenable : Listenable

Base implementation of Listenable for managing listeners and activation lifecycle.

Link copied to clipboard
abstract class BaseReactive<T>(start: ReactiveState<T> = ReactiveState.notReady) : BaseListenable, Reactive<T>

Base implementation of Reactive for managing reactive state and listener notification.

Link copied to clipboard
abstract class BaseReactiveValue<T>(start: T) : BaseListenable, ReactiveValue<T>

Base implementation of ReactiveValue for managing a mutable value and listener notification.

Link copied to clipboard

A basic implementation of a listenable object. Can invoke all listeners and provides a unique identifier for debugging.

Link copied to clipboard
class Constant<T>(val value: T) : ReactiveValue<T>

A reactive value that always holds a constant value and does not notify listeners.

Link copied to clipboard

A mutable reactive value that supports draft editing and publishing. Essentially, this provides an input buffer for a MutableReactive.

Link copied to clipboard
interface Emitter<T> : CoroutineScope
Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class InternalReactiveApi
Link copied to clipboard

A reactive value that can be set after initialization and unset to a not-ready state. Useful for cases where the value is not available at construction time.

Link copied to clipboard

Represents an object that can have listeners attached for change events.

Link copied to clipboard
interface Mutable<T>

Represents a mutable value that can be set asynchronously.

Link copied to clipboard
interface MutableReactive<T> : Reactive<T> , Mutable<T>

Represents a reactive value that can be modified and observed for changes.

Link copied to clipboard

Represents a mutable reactive value that can be modified and observed for changes.

Link copied to clipboard
class MutableRemember<T>(stopListeningWhenOverridden: Boolean = true, useLastWhileLoading: Boolean = false, coroutineContext: CoroutineContext = Dispatchers.Unconfined, initialValue: ReactiveContext.() -> T) : BaseReactive<T> , ReactiveWithMutableValue<T>

A mutable reactive value that can be set directly or calculated automatically from dependencies.

Link copied to clipboard
class MutableRememberSuspending<T>(stopListeningWhenOverridden: Boolean = true, useLastWhileLoading: Boolean = false, coroutineContext: CoroutineContext = Dispatchers.Unconfined, initialValue: suspend CalculationContext.() -> T) : BaseReactive<T> , ReactiveWithMutableValue<T>

This is a suspending version of MutableRemember. A mutable reactive value that can be set directly or calculated automatically from dependencies using a suspending block.

Link copied to clipboard
interface MutableValue<T> : Mutable<T>

Represents a mutable value that can be set synchronously and/or asynchronously.

Link copied to clipboard

A ReactiveValue that can be asynchronously modified.

Link copied to clipboard
Link copied to clipboard
class RawReactive<T>(start: ReactiveState<T> = ReactiveState.notReady) : BaseReactive<T>

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

Link copied to clipboard
interface Reactive<out T> : Listenable

Represents a reactive value that can be observed for changes.

Link copied to clipboard

A wrapper around ArrayList that signals its listeners whenever it is mutated

Link copied to clipboard

A wrapper around HashMap that signals its listeners whenever it is mutated

Link copied to clipboard

A wrapper around LinkedHashSet that signals its listeners whenever it is mutated

Link copied to clipboard
value class ReactiveState<out T>(val raw: T)

Represents the state of a reactive value, including loading, success, and error conditions.

Link copied to clipboard
interface ReactiveValue<out T> : Reactive<T> , ReadOnlyProperty<Any?, T>

Represents an infallible reactive value.

Link copied to clipboard

A Reactive that can be synchronously modified.

Link copied to clipboard
class Remember<T>(coroutineContext: CoroutineContext = Dispatchers.Unconfined, useLastWhileLoading: Boolean = false, action: ReactiveContext.() -> T) : BaseListenable, Reactive<T> , CoroutineScope

A reactive value that remembers the result of a calculation and shares the result among its listeners.

Link copied to clipboard
class RememberSuspending<T>(coroutineContext: CoroutineContext = Dispatchers.Unconfined, useLastWhileLoading: Boolean = false, action: suspend CalculationContext.() -> T) : BaseListenable, Reactive<T> , CoroutineScope

A reactive value that remembers the result of a calculation and shares the result among its listeners.

Link copied to clipboard
interface ResourceUse

Represents a resource that can be used and released. Implementations should provide logic for starting and stopping resource usage.

Link copied to clipboard
class Signal<T>(startValue: T) : BaseReactiveValue<T> , MutableReactiveValue<T>

A mutable reactive value that can be updated and observed.

Properties

Link copied to clipboard
val AppJob: CompletableJob
Link copied to clipboard
val AppScope: CoroutineScope

Functions

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

Adds a listener and immediately runs it once.

Link copied to clipboard
fun <T> mutableRemember(useLastWhileLoading: Boolean = false, coroutineContext: CoroutineContext = Dispatchers.Unconfined, initialValue: ReactiveContext.() -> T): ReactiveWithMutableValue<T>

Creates a mutable reactive value that can be set directly or calculated automatically.

Link copied to clipboard
fun <T> mutableRememberSuspending(useLastWhileLoading: Boolean = false, coroutineContext: CoroutineContext = Dispatchers.Unconfined, initialValue: suspend CalculationContext.() -> T): ReactiveWithMutableValue<T>

This is a suspending version of mutableRemember. Creates a mutable reactive value that can be set directly or calculated automatically using a suspending block.

Link copied to clipboard
fun <T> rawReactiveProcess(scope: CoroutineScope = AppScope, emitter: suspend Emitter<ReactiveState<T>>.() -> Unit): Reactive<T>
Link copied to clipboard
fun <T> reactiveProcess(scope: CoroutineScope = AppScope, emitter: suspend Emitter<T>.() -> Unit): Reactive<T>
Link copied to clipboard
@JvmName(name = "reactiveProcessImplicit")
fun <T> CoroutineScope.reactiveProcess(emitter: suspend Emitter<T>.() -> Unit): Reactive<T>
Link copied to clipboard
inline fun <T> reactiveState(action: () -> T): ReactiveState<T>
Link copied to clipboard
fun <T> remember(coroutineContext: CoroutineContext = Dispatchers.Unconfined, useLastWhileLoading: Boolean = false, action: ReactiveContext.() -> T): Reactive<T>

Creates a reactive value that automatically updates when its dependencies change.

Link copied to clipboard
fun <T> rememberSuspending(coroutineContext: CoroutineContext = Dispatchers.Unconfined, useLastWhileLoading: Boolean = false, action: suspend CalculationContext.() -> T): Reactive<T>

This is a suspending version of remember. Creates a reactive value that automatically updates when its dependencies change.

Link copied to clipboard