Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- user = { id: 1,
- name: jim,
- email: jim@gmail.com,
- entries: 4,
- joined: 07-16-2018
- }
- export const loadUserData = (state = initialStateUser, action = {}) => {
- switch(action.type) {
- case LOAD_USER:
- return Object.assign({}, state, {
- user: {
- id: action.payload.id,
- name: action.payload.name,
- email: action.payload.email,
- entries: action.payload.entries,
- joined: action.payload.joined
- }
- });
- case UPDATE_USER_ENTRIES:
- return {...state, **// NEED HELP HERE** };
- default:
- return state;
- }
- }
Add Comment
Please, Sign In to add comment