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

hashCode int
The hash code for this object.
no setterinherited
newValue → T
The new current value after the state change.
final
oldValue → T
The previous value before the state change occurred.
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.
override

Operators

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