diegocasmo/workouter-web

Create session reducer

Closed this issue · 1 comments

The session reducer should at least expose an API that allows to dispatch the following actions:

SESSION__START
SESSION__EXERCISE_COMPLETED
SESSION__EXERCISE_REST_COMPETED
SESSION__ROUND_REST_COMPETED

Its state must keep track of whether an exercise is being executed, the user is resting before another exercise (restTimePerExercise), or if the user is resting before another round (restTimePerRound). Finally, it should keep track of the time when the workout was startedAt and finishedAt.

Note that it isn't yet necessary to keep track of how much time the user spent per exercise in each round (that will be a part of an upcoming feature).

Note: Since all components of type "form" save their state locally, this would probably be a good opportunity to use the useReducer hook instead of saving such state in Redux (global state).