Created
October 8, 2018 18:16
-
-
Save productioncoder/24e6c385dd0a81d400f751e3a0a3ae7f to your computer and use it in GitHub Desktop.
Composing redux selectors
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
export const getFullName = createSelector( | |
(state) => state.firstName, | |
(state) => action.lastName, | |
(firstName, lastName) => [firstName,lastName].join(' ') | |
); | |
export const getNameWithBirthdate = createSelector( | |
getFullName, | |
state => state.birthday, | |
(fullName, birthday) => `${fullname} born on ${birthday}` | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment