Skip to content

Instantly share code, notes, and snippets.

@rupeshtiwari
Created September 15, 2017 15:34
Show Gist options
  • Save rupeshtiwari/f3466b8dde740cfbae61507dc208ceb3 to your computer and use it in GitHub Desktop.
Save rupeshtiwari/f3466b8dde740cfbae61507dc208ceb3 to your computer and use it in GitHub Desktop.
CreateSelector which takes parameter in selector
const {
createSelector
} = Reselect;
const form = {
firstName: 'Rakesh',
lastName: 'Verma',
age: 12,
height: 157
};
const getLastName = (form) =>
form.lastName;
const isLastNameExist = (name) =>
createSelector(getLastName, (nameProp) => nameProp === name);
console.log('is Verma lastname', isLastNameExist('Verma')(form));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment