# events

Event-driven state primitives: a small pub/sub registry used as a building block by other state-machine pieces.

[`Events`](https://www.hyperfrontend.dev/docs/libraries/state-machine/events/#api-Events) exposes [`on`](https://www.hyperfrontend.dev/docs/libraries/state-machine/events/#api-Events-prop-on) over typed event names, and derives each event from the state changes its own [`dispatch`](https://www.hyperfrontend.dev/docs/libraries/state-machine/events/#api-Events-prop-dispatch) produces, so components can subscribe to lifecycle and state-change notifications without coupling to the dispatcher that publishes them. Used internally by [`LifecycleAwareComponent`](https://www.hyperfrontend.dev/docs/libraries/state-machine/lifecycle-aware-component/#api-LifecycleAwareComponent) and [`Store`](https://www.hyperfrontend.dev/docs/libraries/state-machine/store/#api-Store) to surface state transitions; available on its own for application code that wants the same shape without dragging in a full store.

---

Canonical page: https://www.hyperfrontend.dev/docs/libraries/state-machine/events/
This file: https://www.hyperfrontend.dev/docs/libraries/state-machine/events.md
Documentation index: https://www.hyperfrontend.dev/llms.txt
