Reactive<T> class

A Reactive class that represents a value that can be observed.

The value can be updated, and the change is propagated to its listeners. _middlewares is a list of FluxivityMiddleware instances that can be used to add hooks or intercept the update process. _value is the initial value of the Reactive instance.

Available extensions

Constructors

Reactive(T _value, {List<FluxivityMiddleware<T>>? middlewares})

Properties

hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stream Stream<Snapshot<T>>
Returns a stream of snapshots containing the current and new values.
no setter
value ↔ T
Updates the value and notifies listeners if the value has changed.
getter/setter pair

Methods

addEffect(dynamic effect(Snapshot<T>)) → void
Adds an effect function that gets called whenever the value changes.
addEffect(dynamic effect(Snapshot<List<E>>)) → void

Available on Reactive<List<E>>, provided by the ReactiveListHelpers extension

addEffect(dynamic effect(Snapshot<Map<K, V>>)) → void

Available on Reactive<Map<K, V>>, provided by the ReactiveMapHelpers extension

addEffect(dynamic effect(Snapshot<Set<E>>)) → void

Available on Reactive<Set<E>>, provided by the ReactiveSetHelpers extension

dispose() → void
endBatchUpdate({bool publishAll = false}) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
startBatchUpdate() → void
toString() String
A string representation of this object.
override
unwrap() List<E>

Available on Reactive<List<E>>, provided by the ReactiveListHelpers extension

unwrap() Map<K, V>

Available on Reactive<Map<K, V>>, provided by the ReactiveMapHelpers extension

unwrap() Set<E>

Available on Reactive<Set<E>>, provided by the ReactiveSetHelpers extension

Operators

operator ==(Object other) bool
The equality operator.
override