Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- list: {
- '0': {
- id: 0,
- dueDate: 'By May 28th I Will have: ',
- goals: [
- {
- 0: {...}
- 1: {...}
- 3: {...}
- }
- ]
- }
- '1':{
- id: 0,
- dueDate: 'By June 31st I Will have: ',
- goals: [
- {
- 2: {...}
- 4: {...}
- }
- }
- return {
- ...state,
- [action.payload.keyName]: {
- ...state[action.payload.keyName],
- goals: [
- { ...state[action.payload.keyName].goals, ...action.payload.goal },
- ...state[action.payload.keyName].goals.slice(1, state[action.payload.keyName].goals.length)
- ]
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement