-
-
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
Allows createActionGroup to preserve the case #3693
Comments
I also just noticed the |
Just to have the info here : the PR associated to this issue was closed because it is introducing a breaking change (see the comments in the PR). For now I then had to postpone the use of action groups. |
I'm also postponing the use of action groups for this reason. I think this is essential... ex. For a developer that is new to a project/codebase |
For now i'm using a static class with utility functions as an alternative to createActionGroup |
Find all references is not able to find action reference in createActionGroup in VS Code and vice versa. It is quite a big issue for navigating in a code. Maybe this PR solves that? |
@martinkasa My workaround resolves that problem, with minimal extra code. |
The less-destructive conversion from event name to action name will be introduced in v16. It will work in the following way:
|
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; ```
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; ```
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; ```
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; ```
Which @ngrx/* package(s) are relevant/related to the feature request?
store
Information
I would like to be able to preserve the case of the event keys I put 😬
By the way: thank you very much for the improved APIs, I am totally fan!
Describe any alternatives/workarounds you're currently using
Unfortunately it will considerably increase any refactoring effort, I really like to have the name of my action being the name of its variable + (removing the spaces for the name of actions allows to have more characters visible in the Redux DevTools which helps a lot in case of long names).
I would be willing to submit a PR to fix this issue
The text was updated successfully, but these errors were encountered: