question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enhancement: Configure `storeName` and `actionName` in `devtools` middleware

See original GitHub issue

I 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:closed
  • Created 4 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
JeremyRHcommented, Oct 11, 2019

I added support for this in 2.0.0. @isakkeyten @timkindberg try it out whenever you have time.

0reactions
dai-shicommented, Aug 15, 2020

Assuming this is resolved.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found