YAObserver<V> class
This class represents a single observer.
Constructors
-
YAObserver(YAValueGetter<
V> getValue, {required YAObserverChanged<V> onChanged, YAComparator<V> ? hasChanged, bool updateImmediately = true, bool fireOnFirstUpdate = false, int maxHistoryLength = 0}) - Creates an observer that triggers onChanged whenever the value returned from getValue changes.
Properties
-
getValue
→ YAValueGetter<
V> -
final
-
hasChanged
→ YAComparator<
V> -
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxHistoryLength → int
-
final
-
onChanged
→ YAObserverChanged<
V> -
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
) → void - Updates the value of the observer by executing getValue. If the value has changed since the last call to update, onChanged will be executed.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited