import { TimerTypes , TimerActionTypes , SET_PLAY , SET_TIMER_TYPE , SET_ROUND , SKIP_TIMER , } from "./types" ; const initialState = { round : 1 , playing : false , timerType : "STAY_FOCUS" , } ; export const timerReducer = ( state = initialState , action ) => { switch ( action . type ) { case SET_PLAY : return { ... state , playing : action . payload , } ; case SET_TIMER_TYPE : return { ... state , timerType : action . payload , } ; case SET_ROUND : return { ... state , round : action . payload , } ; case SKIP_TIMER : return { ... state , timerType : action . payload , } ; default : return state ; } } ;