All files / src/reducers user.js

100% Statements 12/12
80% Branches 4/5
100% Functions 3/3
100% Lines 9/9
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 271x 1x   1x     1x           1x       1x     1x       1x 1x    
 
export const reducers = {
  'log out' (state, action) {
    return {}
  },
  'set auth0 user' (state, action) {
    return {
      ...state,
      ...action.payload
    }
  },
  'set id token' (state, action) {
    return {
      ...state,
      idToken: action.payload
    }
  }
}
 
const localStorageAvailable = typeof window !== 'undefined' &&
  typeof window.localStorage !== 'undefined' &&
  typeof window.localStorage.getItem === 'function'
 
export const initialState = {
  ...JSON.parse(localStorageAvailable ? window.localStorage.getItem('user') : '{}')
}