goopscoop / ga-react-tutorial

MIT License
139 stars 50 forks source link

Your example doesn't actually comply with the redux Duck spec. #5

Open SpencerCDixon opened 8 years ago

SpencerCDixon commented 8 years ago

In the rules section located here you'll notice that a duck: MUST have action types in the form npm-module-or-app/reducer/ACTION_TYPE

Your action types arn't using the proper namespace of appname/reducer. That part is extremely important to avoid name collisions in other reducers. IE. I sometimes have the same action type names in different reducers but they don't collide due to the namespacing.

I would recommend changing that in the example code since you link people to it in your medium comment. :-)

Great article though and glad you're giving this pattern awareness in the community! I think it's super important

goopscoop commented 8 years ago

Yeah, you are correct. I'll need to make the change then propagate it through the branches (this repo is designed to function as a Intro to React with each branch being a different phase of development). Will get to this when I have a moment, but feel free to submit a pull request if you'd like ;)