3 ms·
You don't actually have to do this if it bothers you. You can just use the strings inline, but the author (and many of those using Redux) finds it helps to redu
by joshwcomeau 9y ago
You don't actually have to do this if it bothers you. You can just use the strings inline, but the author (and many of those using Redux) finds it helps to reduce errors, by instantly pointing out typos.
There are also patterns to reduce the import issue. For example, https://github.com/erikras/ducks-modular-redux https://github.com/erikras/ducks-modular-redux. I prefer defining my actions with my action creators in one big index, but the point is that there is absolutely a way to mitigate this concern if it bothers you :)
- fiatjaf 9y ago> You can just use the strings inline Well, that would be much worse, don't you think? My point was that having to keep identifiers to everything is silly.
- shriek 9y agoThe point of keeping identifiers is to show you the intents of an action. If any identifiers seem silly to be added then maybe they don't deserve to be going through reducers in the first place.