You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is a snippet from your guide and then a snippet from Angular's guide. Angular seems to "prefer" lowerCamelCase over UPPER_CASE.
ngrx-styleguide:
naming actions (for state)
Note: look at actions for side effects here
DO name actions with a unique name and captial letters - VERB + NOUN.
DO name actions values with - Prefix + VERB + NOUN.
Why?: it's readable.
Why?: actions can be filtered and viewed in redux dev tool easily.
Why?: uniqueness is for making sure only one reducer handles the action.
Consider spelling const variables in lower camel case.
Why? Lower camel case variable names (heroRoutes) are easier to read and understand than the traditional UPPER_SNAKE_CASE names (HERO_ROUTES).
Why? The tradition of naming constants in UPPER_SNAKE_CASE reflects an era before the modern IDEs that quickly reveal the const declaration. TypeScript prevents accidental reassignment.
Do tolerate existing const variables that are spelled in UPPER_SNAKE_CASE.
Why? The tradition of UPPER_SNAKE_CASE remains popular and pervasive, especially in third party modules. It is rarely worth the effort to change them at the risk of breaking existing code and documentation.
Also, there is an interesting comment at reduxjs/redux#1097 from the creator of Redux:
Please use any style you consider appropriate. There's nothing particularly "right" about the style we use in docs. We always discuss important parts (such as reducer purity). The rest is up to you.
Would you agree, based on this information, that we should use lowerCamelCase for our exported action variables?
The text was updated successfully, but these errors were encountered:
hi @marcusreese
By the Angular styleguide, "Do tolerate existing const variables that are spelled in UPPER_SNAKE_CASE..."
I think it's more readable to distinguish when skimming the code.
Also, the ngrx-example app uses the same convention - so i would like to somehow follow this one as well.
Here is a snippet from your guide and then a snippet from Angular's guide. Angular seems to "prefer" lowerCamelCase over UPPER_CASE.
ngrx-styleguide:
https://angular.io/guide/styleguide#constants says:
Also, there is an interesting comment at reduxjs/redux#1097 from the creator of Redux:
Would you agree, based on this information, that we should use lowerCamelCase for our exported action variables?
The text was updated successfully, but these errors were encountered: