Adopt JS standards once userinfo data is in frontend (#1930)

This commit is contained in:
Severiano Badajoz
2020-10-16 11:59:28 -07:00
committed by GitHub
parent 242546371b
commit c9f9549118
7 changed files with 24 additions and 25 deletions
+26
View File
@@ -0,0 +1,26 @@
const UserInfo = (state = {}, action) => {
switch (action.type) {
case "initial data load start":
return {
...state,
loading: true,
error: null,
};
case "userInfo load complete":
return {
...state,
loading: false,
error: null,
...action.userInfo,
};
case "initial data load error":
return {
...state,
error: action.error,
};
default:
return state;
}
};
export default UserInfo;