Hacker News new | past | comments | ask | show | jobs | submit login

The "action creators" from step 4 can be further reduced:

    export const addTodo =
     text => ({
      type: 'ADD_TODO',
      id: nextTodoId++,
      text,
      completed: false
     });
 
    export const setVisibilityFilter =
     filter => ({type: 'SET_VISIBILITY_FILTER', filter});
 
    export const toggleTodo =
     id => ({type: 'TOGGLE_TODO', id});



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: