Open Kaijun opened 8 years ago
Nice! I'll think about it. In some ways I like separate files, some of my actions get a little large, but in general this seems fine to me, having the constants there for reference is nice. The only thing I'd change is the dir names, not a huge fan of .the ./redux dir, not like we have a ./react dir etc.
I think it may be a better approach of combining actions and reducers in one file.
Action names will be implicitly declared as variables, so that the action and reducer are able to use the identical variable as their action names.
It's really easy to control the specific domain of actions and reducers. In the long term, when the action names are getting more and more and probably having naming conflict, redux dispatcher will go wrong. But we can simply define the const variables by using Symbol instead of String, for example:
Tested it works like a charm :smile: