Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const todos = (state = [], action) => {
- if (action.type === 'ADD_TODO') {
- return Object.assign({}, state, [
- ...state,
- {
- name: action.name,
- isCompleted: action.isCompleted,
- }
- ]);
- }
- return state;
- };
- const visiblityFilter = (state = 'all', action) => {
- switch (action.type) {
- case 'SET_VISIBILITY_FILTER':
- return action.filter
- default:
- return state
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement