Skip to content

Instantly share code, notes, and snippets.

@chalu
Created July 18, 2019 18:09
Show Gist options
  • Save chalu/cd5647f7ce2a3b2e556c286246e3c54e to your computer and use it in GitHub Desktop.
Save chalu/cd5647f7ce2a3b2e556c286246e3c54e to your computer and use it in GitHub Desktop.
const getElligibleCustomers = chain(
customerAgeIsOrAbove(18),
isCustomerForMoreThan3Years,
totalItemsBoughtIsOver(50),
shippingAddressIsWithin(['Abuja', 'Lagos', 'Ibadan'])
);
const determineDiscountSale = chain(
getElligibleCustomers,
discountOrdersAt('15%'),
applyTaxOf('5%')
);
const discountSale = determineDiscountSale(todaysOrders);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment