unstated-debug0.3.2 • Public • Published
Debug your Unstated containers with ease
$ npm install unstated-debug
In the root of your app, import
;;;;;UNSTATEDlogStateChanges = false;;
When enabled, it exposes a global object
UNSTATED which you can use in DevTools to explore the containers and their state.
The object contains the following properties:
isEnabled- Same as the below option, but you can change it after init.
logStateChanges- Same as the below option, but you can change it after init.
isCollapsed- Collapse logs by default.
containers- Your containers.
states- The state objects of your containers.
logState()- Logs the current state of your containers.
For example, if you use this in an Electron app, you could pass it
is.development to ensure debugging is disabled in production.
Logs a diff for each state change to the containers. This gives you a live insight into state changes in your app.
MIT © Sindre Sorhus