Debug your react stores with chrome devtools extension.
- 🔍 Inspect stores current state
- 📜 Check store history step-by-step
- 🔬 Compare diff between states
- 📨 Dispatch state directly from devtools
- 🍔 Clickable stack trace for history and listeners
- 🚀 Use in production build
- 📦 Works with isolated stores
- 🎨 Familiar native chrome themes
- from Chrome Web Store;
- or build it with
yarn && yarn run build
and load the extension's folder./extension
;
See how the extension works on Online demo
You don't have to do anything if you use react-stores@5.* or higher. Stores attach to devtool by themselves.
- Use
name
in storeoptions
, otherwise you will see a hashes of the store in the devtool panel - Use
$actionName
when you call setState to better explore store history
const commonStore = new Store(
{
test: "name",
},
{
name: 'Common Store',
// ...otherOptions
}
);
commonStore.setState({
test: "newName"
$actionName: 'changeName'
});
Note: Some functions may now work
Start follow you stores with function
const storeOptions = {
persistence: true
};
const oldStore = new Store(
{
test: "name",
dateField: Date.now()
},
storeOptions
);
window["__REACT_STORES_INSPECTOR__"].attachStore(
oldStore,
"Old Store",
storeOptions
);
oldStore.setState({
test: "newName"
});