LevitReactiveHistoryMiddleware class

A standard middleware for recording the state history.

Inheritance

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>
Returns an unmodifiable list of all recorded changes in the undo stack.
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 and optionally wraps a batch execution.
no setteroverride
onDispose LxOnDispose?
Intercepts and optionally wraps the disposal of a reactive object.
no setterinherited
onGraphChange → void Function(LxReactive computed, List<LxReactive> dependencies)?
Observes dependencies change in a computed reactive object.
no setterinherited
onInit → void Function(LxReactive reactive)?
Observes the initialization of a reactive object.
no setterinherited
onReactiveError → void Function(Object error, StackTrace? stack, LxReactive? context)?
Called when an error occurs during notification.
no setterinherited
onSet LxOnSet?
Intercepts and optionally wraps a value mutation.
no setteroverride
redoChanges List<LevitReactiveChange>
Returns an unmodifiable list of changes available for redo.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
startedListening → void Function(LxReactive reactive, LxListenerContext? context)?
Called when a listener is added to a reactive object.
no setterinherited
stoppedListening → void Function(LxReactive reactive, LxListenerContext? context)?
Called when a listener is removed from a reactive object.
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