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"
});