You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 11, 2018. It is now read-only.
I know that there was a createConstants helper in the past, but it is gone. Are there any ways to replace this with a more concise way? It seems redundant to me to repeat values that are the same as the variable name.
Although I don't really see an easy solution, since we export each const separately, otherwise we could just export const constants = {....} and use a helper like create-constants
The text was updated successfully, but these errors were encountered:
Not much you can do if you want a named export for each actionType.
You can either define them manually (I don't see why the redundancy is an issue as you will rarely have to touch your actionTypes once they have been defined), you can use a utility like redux-action-help which gives you the createConstants helper, or you can get rid of actionTypes altogether and use an actionCreator factory utility like the one in redux-actions.
Personally I don't mind it as I'm namespacing most of my actionTypes anyway, something like this:
Closing as a usage question, and not a project issue. A createConstants helper is probably the way to go, but I removed it in favor of keeping the demo code as straightforward as possible.
In the modules we are using
I know that there was a createConstants helper in the past, but it is gone. Are there any ways to replace this with a more concise way? It seems redundant to me to repeat values that are the same as the variable name.
Although I don't really see an easy solution, since we export each const separately, otherwise we could just export const constants = {....} and use a helper like
create-constants
The text was updated successfully, but these errors were encountered: