ReactiveMutableSet

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

Constructors

Link copied to clipboard
constructor()
constructor(items: Set<T>)
constructor(vararg startingItems: T)
constructor(hashSet: LinkedHashSet<T>)

Properties

Link copied to clipboard
open override val size: Int
Link copied to clipboard
open override val state: ReactiveState<Set<T>>
Link copied to clipboard
open override var value: Set<T>
Link copied to clipboard
@set:JvmName(name = "setValue2")
var <T> MutableValue<T>.value: T

Functions

Link copied to clipboard
open override fun add(element: T): Boolean
Link copied to clipboard
open override fun addAll(elements: Collection<T>): Boolean
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
@JvmName(name = "writableStringAsByte")
fun MutableReactiveValue<String>.asByte(): MutableReactiveValue<Byte?>
@JvmName(name = "writableStringAsByte")
fun MutableReactive<String>.asByte(): MutableReactive<Byte?>
Link copied to clipboard
@JvmName(name = "writableStringAsByteHex")
fun MutableReactiveValue<String>.asByteHex(): MutableReactiveValue<Byte?>
@JvmName(name = "writableStringAsByteHex")
fun MutableReactive<String>.asByteHex(): MutableReactive<Byte?>
Link copied to clipboard
@JvmName(name = "writableIntAsDoubleNullable")
fun MutableReactiveValue<Int?>.asDouble(): MutableReactiveValue<Double?>
@JvmName(name = "writableStringAsDouble")
fun MutableReactiveValue<String>.asDouble(): MutableReactiveValue<Double?>
@JvmName(name = "writableIntAsDoubleNullable")
fun MutableReactive<Int?>.asDouble(): MutableReactive<Double?>
@JvmName(name = "writableStringAsDouble")
fun MutableReactive<String>.asDouble(): MutableReactive<Double?>
Link copied to clipboard
@JvmName(name = "writableStringAsFloat")
fun MutableReactiveValue<String>.asFloat(): MutableReactiveValue<Float?>
@JvmName(name = "writableStringAsFloat")
fun MutableReactive<String>.asFloat(): MutableReactive<Float?>
Link copied to clipboard
@JvmName(name = "writableStringAsInt")
fun MutableReactiveValue<String>.asInt(): MutableReactiveValue<Int?>
@JvmName(name = "writableStringAsInt")
fun MutableReactive<String>.asInt(): MutableReactive<Int?>
Link copied to clipboard
@JvmName(name = "writableStringAsIntHex")
fun MutableReactiveValue<String>.asIntHex(): MutableReactiveValue<Int?>
@JvmName(name = "writableStringAsIntHex")
fun MutableReactive<String>.asIntHex(): MutableReactive<Int?>
Link copied to clipboard
@JvmName(name = "writableStringAsLong")
fun MutableReactiveValue<String>.asLong(): MutableReactiveValue<Long?>
@JvmName(name = "writableStringAsLong")
fun MutableReactive<String>.asLong(): MutableReactive<Long?>
Link copied to clipboard
@JvmName(name = "writableStringAsLongHex")
fun MutableReactiveValue<String>.asLongHex(): MutableReactiveValue<Long?>
@JvmName(name = "writableStringAsLongHex")
fun MutableReactive<String>.asLongHex(): MutableReactive<Long?>
Link copied to clipboard
fun <T> MutableReactiveValue<T>.assert(summary: String, description: String = summary, setOnIssue: Boolean = true, condition: (T) -> Boolean): MutableValidatedValue<T>

Asserts a condition on this MutableReactiveValue instance and reports an issue if the condition fails.

fun <T> MutableReactive<T>.assert(summary: String, description: String = summary, setOnIssue: Boolean = true, condition: (T) -> Boolean): MutableValidated<T>

Asserts a condition on this MutableReactive instance and reports an issue if the condition fails.

Link copied to clipboard
@JvmName(name = "writableStringAsShort")
fun MutableReactiveValue<String>.asShort(): MutableReactiveValue<Short?>
@JvmName(name = "writableStringAsShort")
fun MutableReactive<String>.asShort(): MutableReactive<Short?>
Link copied to clipboard
@JvmName(name = "writableStringAsShortHex")
fun MutableReactiveValue<String>.asShortHex(): MutableReactiveValue<Short?>
@JvmName(name = "writableStringAsShortHex")
fun MutableReactive<String>.asShortHex(): MutableReactive<Short?>
Link copied to clipboard
@JvmName(name = "writableStringAsUByteHex")
fun MutableReactiveValue<String>.asUByteHex(): MutableReactiveValue<UByte?>
@JvmName(name = "writableStringAsUByteHex")
fun MutableReactive<String>.asUByteHex(): MutableReactive<UByte?>
Link copied to clipboard
@JvmName(name = "writableStringAsUIntHex")
fun MutableReactiveValue<String>.asUIntHex(): MutableReactiveValue<UInt?>
@JvmName(name = "writableStringAsUIntHex")
fun MutableReactive<String>.asUIntHex(): MutableReactive<UInt?>
Link copied to clipboard
@JvmName(name = "writableStringAsULongHex")
fun MutableReactiveValue<String>.asULongHex(): MutableReactiveValue<ULong?>
@JvmName(name = "writableStringAsULongHex")
fun MutableReactive<String>.asULongHex(): MutableReactive<ULong?>
Link copied to clipboard
@JvmName(name = "writableStringAsUShortHex")
fun MutableReactiveValue<String>.asUShortHex(): MutableReactiveValue<UShort?>
@JvmName(name = "writableStringAsUShortHex")
fun MutableReactive<String>.asUShortHex(): MutableReactive<UShort?>
Link copied to clipboard
suspend fun <T> ReactiveValue<T>.await(): T
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

Adds a validation check to a MutableReactiveValue instance, returning a MutableValidatedValue that tracks issues.

Adds a validation check to a MutableReactive instance, returning a MutableValidated that tracks issues.

Link copied to clipboard
open override fun clear()
Link copied to clipboard
open operator override fun contains(element: T): Boolean
Link copied to clipboard
@JvmName(name = "containsList")
infix fun <T> MutableReactive<List<T>>.contains(value: T): MutableReactive<Boolean>
Link copied to clipboard
open override fun containsAll(elements: Collection<T>): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
inline suspend fun <T> Reactive<T>.exception(): Exception?
Link copied to clipboard
Link copied to clipboard
open operator override fun getValue(thisRef: Any?, property: KProperty<*>): Set<T>
Link copied to clipboard
inline suspend operator fun <T> ReactiveValue<T>.invoke(): T
inline suspend operator fun <T> Reactive<T>.invoke(): T
Link copied to clipboard
open override fun isEmpty(): Boolean
Link copied to clipboard
open operator override fun iterator(): MutableIterator<T>
Link copied to clipboard
open override fun <L> lens(get: (Set<T>) -> L, set: (L) -> Set<T>): MutableReactiveValue<L>

'Lenses' a new type from this MutableReactive. This is useful when translating one type to another for user input, or safe type coercion.

open override fun <L> lens(get: (Set<T>) -> L, modify: (Set<T>, L) -> Set<T>): MutableReactiveValue<L>

'Lenses' a subtype from this MutableReactive. This is useful for extracting properties from a data class or modifying a single item in a collection.

Link copied to clipboard
fun <T, L> ReactiveValue<T>.lens(get: (T) -> L): ReactiveValue<L>
fun <T, L> Reactive<T>.lens(get: (T) -> L): Reactive<L>
Link copied to clipboard
@JvmName(name = "setLensByElement")
fun <E, ID> MutableReactive<Set<E>>.lensByElement(identity: (E) -> ID): LensByElement<E, ID, LensByElement.Element<E, ID, *>>
@JvmName(name = "setLensByElement")
fun <E, ID, W> MutableReactive<Set<E>>.lensByElement(identity: (E) -> ID, map: CalculationContext.(MutableWithReactiveValue<E>) -> W): LensByElement<E, ID, W>
Link copied to clipboard

THIS ONLY WORKS IF THE set on the receiver never manipulates the input before notifying.

Link copied to clipboard
@JvmName(name = "setLensByElementWithIdentity")
fun <E, ID> MutableReactive<Set<E>>.lensByElementWithIdentity(identity: (E) -> ID): LensByElement<E, ID, LensByElement.Element<E, ID, *>>
@JvmName(name = "setLensByElementWithIdentity")
fun <E, ID, W> MutableReactive<Set<E>>.lensByElementWithIdentity(identity: (E) -> ID, map: CalculationContext.(MutableWithReactiveValue<E>) -> W): LensByElement<E, ID, W>
Link copied to clipboard
fun <T> Listenable.lensListenable(get: () -> T): Reactive<T>
Link copied to clipboard
infix suspend fun <T> MutableReactiveValue<T>.modify(action: suspend (T) -> T)
infix suspend fun <T> MutableReactive<T>.modify(action: suspend (T) -> T)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
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
Link copied to clipboard
open override fun remove(element: T): Boolean
Link copied to clipboard
open override fun removeAll(elements: Collection<T>): Boolean
Link copied to clipboard
open override fun retainAll(elements: Collection<T>): Boolean
Link copied to clipboard
open infix suspend override fun set(value: Set<T>)
Link copied to clipboard
open operator override fun setValue(thisRef: Any?, property: KProperty<*>, value: Set<T>)
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
Link copied to clipboard
fun <T> MutableReactiveValue<T>.validate(setOnIssue: Boolean = true, validate: (T) -> String?): MutableValidatedValue<T>

Adds a validation check to this MutableReactiveValue instance.

fun <T> MutableReactive<T>.validate(setOnIssue: Boolean = true, validate: (T) -> String?): MutableValidated<T>

Adds a validation check to this MutableReactive instance.

Link copied to clipboard
fun MutableReactiveValue<String>.validateNotBlank(summary: String = "Cannot be blank.", description: String = summary, setOnIssue: Boolean = true): MutableValidatedValue<String>

Validates that the value of this MutableReactiveValue is not blank (for String values).

fun MutableReactive<String>.validateNotBlank(summary: String = "Cannot be blank.", description: String = summary, setOnIssue: Boolean = true): MutableValidated<String>

Validates that the value of this MutableReactive is not blank (for String values).

Link copied to clipboard
fun <T : Any> MutableReactiveValue<T?>.validateNotNull(summary: String = "Cannot be blank.", description: String = summary, setOnIssue: Boolean = true): MutableValidatedValue<T?>

Validates that the value of this MutableReactiveValue is not null.

fun <T : Any> MutableReactive<T?>.validateNotNull(summary: String = "Cannot be blank.", description: String = summary, setOnIssue: Boolean = true): MutableValidated<T?>

Validates that the value of this MutableReactive is not null.

Link copied to clipboard
open infix override fun valueSet(value: Set<T>)
Link copied to clipboard
fun <T> Reactive<T>.withWrite(action: suspend Reactive<T>.(T) -> Unit): MutableReactive<T>