userReducer.js 396 Bytes
Newer Older
Giang Tran committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
import {LOGIN} from '../actions/actionTypes';

const initialState = {
  user: {name: 'Tdgiang', pass: 'abc'},
  isSignedIn: false,
  expiredTime: new Date(),
  userInfo: {},
};
// @ts-ignore
export default function userReducer(state = initialState, action) {
  switch (action.type) {
    case LOGIN: {
      return {...action.data, isSignedIn: true};
    }
    default:
      return state;
  }
}