-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(store): preserve the event name case with createActionGroup
Closes #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; ```
- Loading branch information
1 parent
73eb55c
commit 13972c2
Showing
6 changed files
with
40 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
export function capitalize<T extends string>(text: T): Capitalize<T> { | ||
return (text.charAt(0).toUpperCase() + text.substring(1)) as Capitalize<T>; | ||
} | ||
|
||
export function uncapitalize<T extends string>(text: T): Uncapitalize<T> { | ||
return (text.charAt(0).toLowerCase() + text.substring(1)) as Uncapitalize<T>; | ||
} |