Skip to content

ibitcy/react-stores-devtools-extension

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Stores Devtools Extension

React Stores Inspector

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

screen_light

How to install

Demo

See how the extension works on Online demo

Usage

You don't have to do anything if you use react-stores@5.* or higher. Stores attach to devtool by themselves.

Advices

  • Use name in store options, 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'
});

For old versions

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

screen_dark

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published