Enhancement: Configure `storeName` and `actionName` in `devtools` middleware
See original GitHub issueI think it would be nice to supply a store “name” to the devtools middleware to more easily distinguish which store the “setState” actions are originating from.
API might be something like this:
const [useStore] = create(devtools('ProductsStore', createFn))
Then in the Redux devtools you’d see:
@@INIT
ProductsStore setState()
As an added bonus, if there was someway to pass a name to each call to set
, for example:
const [useStore] = create(devtools('ProductsStore', (set) => ({
actions: {
loadProducts() {
set('loadProducts', state => ({ products }))
}
}
})))
Then in the Redux devtools you’d see:
@@INIT
ProductsStore > loadProducts
It would probably be good if both functions could optionally take or omit the 1st string param without throwing an error, that way there is no penalty if you don’t declare a store or action name.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Configure `storeName` and `actionName` in `devtools ...
I think it would be nice to supply a store "name" to the devtools middleware to more easily distinguish which store the "setState"...
Read more >Configuring Your Store | Redux
A middleware which logs dispatched actions and the resulting new state. An enhancer which logs the time taken for the reducers to process...
Read more >Setting Up Redux DevTools — A Simple Guide - Medium
This tutorial assumes that you have an understanding of setting up stores, middleware, and actions in redux. Setting up Redux DevTools in a ......
Read more >Connecting Redux devtools and Thunk middleware to store
I just used the compose method to combine Thunk and Dev Tools. import { createStore, applyMiddleware , compose} from 'redux' import thunk ...
Read more >Redux Middleware and Enhancers: Getting Redux to log ...
a form of Store Enhancer. The Redux DevTools enhancer enables you to travel time and step through actions dispatched to your reducers. There...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I added support for this in 2.0.0. @isakkeyten @timkindberg try it out whenever you have time.
Assuming this is resolved.