LevitReactiveHistoryMiddleware class
A standard middleware for recording the state history.
- Inheritance
-
- Object
- LevitReactiveMiddleware
- LevitReactiveHistoryMiddleware
Constructors
- LevitReactiveHistoryMiddleware()
- Creates a history tracking middleware.
Properties
- canRedo → bool
-
Whether there are changes available to redo.
no setter
- canUndo → bool
-
Whether there are changes available to undo.
no setter
-
changes
→ List<
LevitReactiveChange> -
The stack of past changes (Undo).
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- length → int
-
The number of recorded changes in the undo stack.
no setter
- onBatch → LxOnBatch?
-
Intercepts batch operations.
no setteroverride
- onDispose → LxOnDispose?
-
Intercepts disposal.
no setterinherited
-
onGraphChange
→ void Function(LxReactive computed, List<
LxReactive> dependencies)? -
Observes changes to the dependency graph of a computed value.
no setterinherited
- onInit → void Function(LxReactive reactive)?
-
Observes initialization of new reactive objects.
no setterinherited
- onReactiveError → void Function(Object error, StackTrace? stack, LxReactive? context)?
-
Observes errors caught during notification.
no setterinherited
- onSet → LxOnSet?
-
Intercepts value mutations.
no setteroverride
-
redoChanges
→ List<
LevitReactiveChange> -
The stack of reverted changes (Redo).
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- startedListening → void Function(LxReactive reactive, LxListenerContext? context)?
-
Observes when a new listener is added.
no setterinherited
- stoppedListening → void Function(LxReactive reactive, LxListenerContext? context)?
-
Observes when a listener is removed.
no setterinherited
Methods
-
changesOfType(
Type type) → List< LevitReactiveChange> - Returns all changes of a specific type.
-
clear(
) → void -
Clears the history state.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
printHistory(
) → void - Prints the current history to the console for debugging.
-
redo(
) → bool - Re-applies the most recent undone state change.
-
toString(
) → String -
A string representation of this object.
inherited
-
undo(
) → bool - Reverts the most recent state change.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- maxHistorySize ↔ int
-
The maximum number of changes to keep in the undo stack.
getter/setter pair