const initial = {
isLogin: false,
userName: "",
email: "",
id: "",
days: []
};
const user = (state = initial, action) => {
switch (action.type) {
case "IS_AUTH":
return {
isLogin: action.payload
};
case "USER_DATA":
return {
userName: action.payload.userName,
email: action.payload.email,
id: action.payload.id
};
case "DAYS":
return [
...state.days,
action.payload
];
default:
return state;
}
};
export default user;