Redux: UpdatingNormalizedData.md has case without switch

Created on 26 Oct 2016  Â·  4Comments  Â·  Source: reduxjs/redux

This is just a comment about the docs which I found confusing. It shows reducers that look like this:

function allComments(state = [], action) {
    case "ADD_COMMENT" : return addCommentId(state, action);
    default : return state;
}

Not sure if that is using some plugin, but I think you need a switch statement to have a case.

Most helpful comment

I totally blame @jimbolla for not peer reviewing hard enough and @timdorr for just blindly merging in those docs. Clearly the maintainers of this library should have done a better job of keeping out shoddy writing.

:)

All 4 comments

Looks like a mistake. Want to submit a PR?

I totally blame @jimbolla for not peer reviewing hard enough and @timdorr for just blindly merging in those docs. Clearly the maintainers of this library should have done a better job of keeping out shoddy writing.

:)

Thanks, @markerikson. But yeah, this is better as a PR. Should be simple.

Just went ahead and fixed this one, so it should be taken care of now!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

caojinli picture caojinli  Â·  3Comments

elado picture elado  Â·  3Comments

benoneal picture benoneal  Â·  3Comments

olalonde picture olalonde  Â·  3Comments

dmitry-zaets picture dmitry-zaets  Â·  3Comments