TitanHistoryObserver class
An observer that records state change history for time-travel debugging.
Uses a ring buffer internally for O(1) insertion even at capacity.
final observer = TitanHistoryObserver();
TitanObserver.instance = observer;
// Later: inspect history
for (final entry in observer.history) {
print('${entry.stateName}: ${entry.oldValue} -> ${entry.newValue}');
}
- Inheritance
-
- Object
- TitanObserver
- TitanHistoryObserver
Constructors
- TitanHistoryObserver({int maxHistory = 1000})
- Creates a history observer.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
history
→ List<
StateChangeRecord> -
The recorded state change history (oldest first).
no setter
- length → int
-
The number of recorded changes.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clear(
) → void - Clears all recorded history.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onBatchEnd(
) → void -
Called when a batch mutation ends and notifications are flushed.
inherited
-
onBatchStart(
) → void -
Called when a batch mutation starts.
inherited
-
onEffectError(
TitanEffect effect, Object error, StackTrace stackTrace) → void -
Called when a TitanEffect throws an error during execution.
inherited
-
onEffectRun(
TitanEffect effect) → void -
Called when a TitanEffect executes.
inherited
-
onPillarDispose(
Pillar pillar) → void -
Called when a Pillar is disposed.
inherited
-
onPillarInit(
Pillar pillar) → void -
Called when a Pillar is initialized.
inherited
-
onStateChanged(
{required TitanState state, required dynamic oldValue, required dynamic newValue}) → void -
Called whenever a TitanState value changes.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited