Store<T> class
A store for global state management with usage pattern validation
Constructors
- Store(T _state)
- Create a store with initial state
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state → T
-
Get the current state (with usage tracking)
no setter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setState(
T newState) → void - Update the state
-
subscribe(
void listener(T)) → void - Register a listener (used by hooks)
-
toString(
) → String -
A string representation of this object.
inherited
-
trackHookAccess(
String componentId, String componentType) → void - Track hook-based access (called from StoreHook)
-
unsubscribe(
void listener(T)) → void - Unregister a listener
-
updateState(
T updater(T)) → void - Update the state using a function
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited