user.reducer.js 305 B

123456789101112
  1. import { LOGIN_SUCCESS, LOGIN_FAIL } from "../actions/user";
  2. export const userReducer = (state = {}, action) => {
  3. switch (action.type) {
  4. case LOGIN_SUCCESS:
  5. return { isLogin: true, data: action.payload };
  6. case LOGIN_FAIL:
  7. return { isLogin: false, data: {} };
  8. default:
  9. return state;
  10. }
  11. };