MCPcopy Create free account
hub / github.com/basir/node-react-ecommerce / userSigninReducer

Function userSigninReducer

frontend/src/reducers/userReducers.js:3–15  ·  view source on GitHub ↗
(state = {}, action)

Source from the content-addressed store, hash-verified

1import { 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
3function 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
17function userUpdateReducer(state = {}, action) {
18 switch (action.type) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected