ReferenceStore
useStore
Hook to access store state and actions with optional selector-based subscriptions
Import
useStore subscribes to a store instance directly. It has the same two overloads as usePlayer — without a selector for store access, or with a selector for reactive state. Within Player, usePlayer is usually simpler since it reads the store from context. Reach for useStore when you have a store instance directly or need to derive computed values from the store.
Examples
Store Access
Call useStore(store) without a selector to get the store instance back for imperative actions. The component does not subscribe to state changes.
Selector Subscription
Pass a selector to derive and subscribe to computed values from the store. The component re-renders when the derived value changes, using shallow equality by default.
- Remaining
- 0.0s
- Progress
- 0.0%