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< ? middlewares})T> >
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< )) → voidE> > -
Available on Reactive<
List< , provided by the ReactiveListHelpers extensionE> > -
addEffect(
dynamic effect(Snapshot< Map< )) → voidK, V> > -
Available on Reactive<
Map< , provided by the ReactiveMapHelpers extensionK, V> > -
addEffect(
dynamic effect(Snapshot< Set< )) → voidE> > -
Available on Reactive<
Set< , provided by the ReactiveSetHelpers extensionE> > -
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< , provided by the ReactiveListHelpers extensionE> > -
unwrap(
) → Map< K, V> -
Available on Reactive<
Map< , provided by the ReactiveMapHelpers extensionK, V> > -
unwrap(
) → Set< E> -
Available on Reactive<
Set< , provided by the ReactiveSetHelpers extensionE> >
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override