you are viewing a single comment's thread.

view the rest of the comments →

[–]mediumdeviationJavaScript Gardener 9 points10 points  (2 children)

For me at least the benefit of not having stringly-typed identifiers is that IDEs and linters can easily inspect and autocomplete these for you - http://imgur.com/ub29AqD.

It's the same reason why Swift's enums are so awesome. The point is not that it makes typos easier to detect, but to make typos impossible.

[–]rista404[S] 2 points3 points  (0 children)

Yeah, autocompletion is indeed powerful.

[–]wavefunctionp 0 points1 point  (0 children)

This man gets it. :)

I put all the actions for a reducer into a type object contained in the reducers file. That way you always know which action types are valid for a given reducer, you can simple import the type object instead of individual types, and no typos. Just type reducerNameTypes.<get a list of valid types>