@hyperfrontend/state-machine/state-change

state-change

State-transition tracking primitive: pairs the previous and current state of a slice for change-driven side effects.

StateChange represents the diff between two state snapshots so subscribers (UI render hooks, side-effect runners, lifecycle callbacks) can react to specific transitions rather than every dispatch. The class is consumed internally by LifecycleAwareComponent and exposed for application code that wants to build its own transition-driven behavior on top of the store.

API Reference

Classes

§class

StateChange

Tracks state changes and notifies registered callbacks when state transitions occur.

Properties

Methods

§addItem(newState: DerivedState): StateChange
§registerCallback(callback: StateChangeHandler): StateChange