(state = {}, action)
| 1 | import { USER_SIGNIN_REQUEST, USER_SIGNIN_SUCCESS, USER_SIGNIN_FAIL, USER_REGISTER_REQUEST, USER_REGISTER_SUCCESS, USER_REGISTER_FAIL, USER_LOGOUT, USER_UPDATE_REQUEST, USER_UPDATE_SUCCESS, USER_UPDATE_FAIL } from "../constants/userConstants"; |
| 2 | |
| 3 | function userSigninReducer(state = {}, action) { |
| 4 | switch (action.type) { |
| 5 | case USER_SIGNIN_REQUEST: |
| 6 | return { loading: true }; |
| 7 | case USER_SIGNIN_SUCCESS: |
| 8 | return { loading: false, userInfo: action.payload }; |
| 9 | case USER_SIGNIN_FAIL: |
| 10 | return { loading: false, error: action.payload }; |
| 11 | case USER_LOGOUT: |
| 12 | return {}; |
| 13 | default: return state; |
| 14 | } |
| 15 | } |
| 16 | |
| 17 | function userUpdateReducer(state = {}, action) { |
| 18 | switch (action.type) { |
nothing calls this directly
no outgoing calls
no test coverage detected