SHARE
TWEET

Untitled

a guest May 22nd, 2019 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import _ from 'lodash'
  2.  
  3. export const buildFullState = (...fns) => compose(fns)({
  4.   activities: [],
  5.   apiBaseUrls: {
  6.     activitiesApi: '/activities',
  7.     authApi: '/auth'
  8.   }
  9. });
  10.  
  11. export const withActivities = (activities) => (current) => ({
  12.   ...current,
  13.   activities: [
  14.     ...current.activities,
  15.     ...activities
  16.   ]
  17. });
  18.  
  19. export const withApiBaseUrls = (apiBaseUrls) => (current) => ({
  20.   ...current,
  21.   apiBaseUrls
  22. });
  23.  
  24. const compose = (fns) => _.flow(fns);
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