daily pastebin goal
62%
SHARE
TWEET

Untitled

a guest Oct 11th, 2018 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (...)
  2. import { createSelector } from 'reselect';
  3.  
  4. const birthDateSelector = state => state.user.birthdate;
  5. const countrySelector = state => state.user.location.country;
  6.  
  7. export const ageSelector = createSelector(
  8.   birthDateSelector,
  9.   dateString => moment().year() - moment(dateString).year(),
  10. );
  11.  
  12. export const regionSelector = createSelector(
  13.   countrySelector,
  14.   country => regionHelper.getRegion(country),
  15. );
  16.  
  17. export const isEligibleSelector = createSelector(
  18.   ageSelector,
  19.   regionSelector,
  20.   (age, region) => (age > 18 && region === 'LA'),
  21. );
  22.  
  23. (...)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top