-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(store): preserve the event name case with createActionGroup #3832
feat(store): preserve the event name case with createActionGroup #3832
Conversation
✅ Deploy Preview for ngrx-io ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site settings. |
Join<TitleCase<Lowercase<Trim<EventName>>>> | ||
Join<TitleCase<EventName>> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trim
is also removed here because spaces will be removed by Join
anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Do you think that we also need to update the docs?
An action group uses the event descriptions to create properties within the group that represent the action(s). The property names are auto-generated and are the camelCased version of the event description
This sentence is still valid because we're still camel-casing the event name. 😅 I plan to improve the "Action Group" page and also add an alternative way of defining event names in a separate PR. |
ec219aa
to
3c29f9d
Compare
3c29f9d
to
59cbb12
Compare
Closes ngrx#3693 BREAKING CHANGES: The event name case is preserved when converting to the action name by using the `createActionGroup` function. BEFORE: All letters of the event name will be lowercase, except for the initial letters of words starting from the second word, which will be uppercase. ```ts const authApiActions = createActionGroup({ source: 'Auth API', events: { 'LogIn Success': emptyProps(), 'login failure': emptyProps(), 'Logout Success': emptyProps(), logoutFailure: emptyProps(), }, }); // generated actions: const { loginSuccess, loginFailure, logoutSuccess, logoutfailure, } = authApiActions; ``` AFTER: The initial letter of the first word of the event name will be lowercase, and the initial letters of the other words will be uppercase. The case of other letters in the event name will remain the same. ```ts const { logInSuccess, loginFailure, logoutSuccess, logoutFailure, } = authApiActions; ```
59cbb12
to
13972c2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Closes #3693
All letters of the event name will be lowercase, except for the initial letters of words starting from the second word, which will be uppercase.
What is the new behavior?
The initial letter of the first word of the event name will be lowercase, and the initial letters of the other words will be uppercase. The case of other letters in the event name will remain the same.
Does this PR introduce a breaking change?
BREAKING CHANGES:
The event name case is preserved when converting to the action name by using the
createActionGroup
function.BEFORE:
All letters of the event name will be lowercase, except for the initial letters of words starting from the second word, which will be uppercase.
AFTER:
The initial letter of the first word of the event name will be lowercase, and the initial letters of the other words will be uppercase. The case of other letters in the event name will remain the same.