Reducers for EditTask

We should also update our reducers to handle these newly introduced actions. We should do the following:

  • Expand the defaultState object, including the date, dateSelected, expanded, formattedDate, and selectedTaskObject properties
  • Add a helper function to format a date with MomentJS
  • Create a new switch case for the singleTask reducer to handle the SAVE_SELECTED_TASK_DETAILS action
  • Build a new selectedTask reducer for temporarily storing and modifying the selectedTaskObject being edited by the user
  • Extend the listOfTasks reducer to handle each of the new actions, delegating them to either the singleTask or selectedTask reducers when necessary


The defaultState object has gotten larger to accommodate new information ...

Get React Native By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.