Inspector
An inspector is a function that "inspects" the store's actions. Inspectors are called every time an action is dispatched to the store. They perform tasks like logging and recording actions – e.g. for time travel debugging.
Zedux takes special care to make sure that a store's inspectors are called every time the store's state may change. So store.hydrate()
, store.setState()
, inducers, and actions dispatched to child stores will all find a way to notify the store's inspectors of a serializable action that can be used to reproduce the state update (#timetravel).
Definition
interface Inspector {
(storeBase: StoreBase, action: MetaChainNode): void
}
storeBase - The StoreBase of the store.
action - A MetaChainNode containing the dispatched action.
Notes
Read up on how the store interacts with the inspector layer in the inspector layer guide.