All files / src/reducers user.js

89.74% Statements 35/39
70.59% Branches 12/17
77.78% Functions 7/9
100% Lines 9/9

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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 276x 1x   1x     1x           1x       1x     1x       1x 1x    
IEEE
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') : '{}')
}