Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const initialState = {
- categories: []
- }
- case "FETCHING_SUCCESS":
- return {
- ...state,
- isAdding: false,
- categories: [...state.categories, action.data]
- }
- [
- {id:1, name: 'name01', someId: 11},
- {id:2, name: 'name02', someId: 22},
- {id:3, name: 'name03', someId: 33}
- ]
- case "FETCHING_SUCCESS":
- return {
- ...state,
- isAdding: false,
- categories: action.data // <= Notice This
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement