JStateRecorder<T extends JState> class
Records every state a JController emits, in order.
The state present when the recorder is attached is not recorded, so states contains only the changes that follow. Equal consecutive states never appear, because controllers skip them.
final recorder = JStateRecorder(controller);
await controller.intent(IncrementIntent());
expect(recorder.states, [const CounterState(count: 1)]);
recorder.dispose();
Constructors
-
JStateRecorder(JController<
T> controller)
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- lastState → T?
-
The most recent recorded state, or
nullif none changed yet.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
states
→ List<
T> -
The states emitted since this recorder was attached.
no setter
Methods
-
clear(
) → void - Forgets everything recorded so far.
-
dispose(
) → void - Stops recording. Recorded states remain readable.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited