Skip to content

Instantly share code, notes, and snippets.

@chalu
Created July 18, 2019 18:00
Show Gist options
  • Select an option

  • Save chalu/d0f8fefc6feefd86f02518f455652dc4 to your computer and use it in GitHub Desktop.

Select an option

Save chalu/d0f8fefc6feefd86f02518f455652dc4 to your computer and use it in GitHub Desktop.
const isFemale = match('gender', is('female'));
const isYoungAdult = match('age', isOrOver(18));
const canPlayNightOwl = match('age', isUnder(60));
const ageIsSpecialNumber = match('age', isMultipleOf(4));
const getSpecialFemaleDevs = chain(
isFemale,
isYoungAdult,
canPlayNightOwl,
ageIsSpecialNumber
);
const specialFemales = getSpecialFemaleDevs(data);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment