Skip to content

Commit

Permalink
devTools reducer
Browse files Browse the repository at this point in the history
  • Loading branch information
MacKentoch committed Nov 17, 2018
1 parent 453a3b7 commit 56a5d6d
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions src/front/contexts/withDevTools/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// #region devtools reducer
const initialState = {
user: {},
auth: {},
};

export const reducer = (
Expand All @@ -12,15 +12,11 @@ export const reducer = (
/* eslint-disable no-unused-vars */
switch (action.type) {
// #region user context
case 'USER_REGISTER_REQUEST':
case 'USER_REGISTER_SUCCESS':
case 'USER_REGISTER_ERROR':
case 'USER_LOGIN_REQUEST':
case 'USER_LOGIN_SUCCESS':
case 'USER_LOGIN_ERROR':
case 'USER_LOGOUT_REQUEST':
case 'USER_LOGOUT_SUCESS':
case 'USER_LOGOUT_ERROR': {
case 'AUTH_CHECK_IS_AUTHENTICATED':
case 'AUTH_CHECK_TOKEN_IS_EXPIRED':
case 'AUTH_SET_TOKEN':
case 'AUTH_SET_USER_INFO':
case 'AUTH_DISCONNECT_USER': {
const { type, state: context, ...rest } = action;
return { ...state, user: { context, ...rest } };
}
Expand All @@ -33,4 +29,4 @@ export const reducer = (
};
// #endregion

export default reducer;
export default reducer;

0 comments on commit 56a5d6d

Please sign in to comment.