Skip to content

Instantly share code, notes, and snippets.

@productioncoder
Created October 8, 2018 18:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save productioncoder/24e6c385dd0a81d400f751e3a0a3ae7f to your computer and use it in GitHub Desktop.
Save productioncoder/24e6c385dd0a81d400f751e3a0a3ae7f to your computer and use it in GitHub Desktop.
Composing redux selectors
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