Guest User

Untitled

a guest
Oct 17th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. const add= (stateaction) => {
  2. switch (action.type) {
  3. case "ADD":
  4. const {payload} = action;/// <=
  5. return({...state, payload}); // <= instead of thes two lines
  6. default:
  7. return state;
  8. }
  9. };
Add Comment
Please, Sign In to add comment