Snapshot<T> class
A container class that holds both the previous and current values during a state change.
The Snapshot class is used throughout Fluxivity to represent state transitions. It's passed to stream listeners and effect callbacks to provide context about what changed.
Example usage:
final counter = Reactive(0);
// Add an effect that can access both old and new values
counter.addEffect((Snapshot<int> snapshot) {
print('Counter changed from ${snapshot.oldValue} to ${snapshot.newValue}');
});
counter.value = 1; // Prints: "Counter changed from 0 to 1"
Constructors
- Snapshot(T oldValue, T newValue)
- Creates a new snapshot containing both old and new values.
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited