Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2017
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. const initialState = {
  2. categories: []
  3. }
  4.  
  5.  
  6. case "FETCHING_SUCCESS":
  7. return {
  8. ...state,
  9. isAdding: false,
  10. categories: [...state.categories, action.data]
  11. }
  12.  
  13. [
  14. {id:1, name: 'name01', someId: 11},
  15. {id:2, name: 'name02', someId: 22},
  16. {id:3, name: 'name03', someId: 33}
  17. ]
  18.  
  19. case "FETCHING_SUCCESS":
  20. return {
  21. ...state,
  22. isAdding: false,
  23. categories: action.data // <= Notice This
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement