Advertisement
Guest User

Untitled

a guest
Aug 25th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. const todos = (state = [], action) => {
  2. if (action.type === 'ADD_TODO') {
  3. return Object.assign({}, state, [
  4. ...state,
  5. {
  6. name: action.name,
  7. isCompleted: action.isCompleted,
  8. }
  9. ]);
  10. }
  11. return state;
  12. };
  13.  
  14. const visiblityFilter = (state = 'all', action) => {
  15. switch (action.type) {
  16. case 'SET_VISIBILITY_FILTER':
  17. return action.filter
  18. default:
  19. return state
  20. }
  21. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement