import { handleActions } from 'redux-actions' ; import * as Actions from '../constants/actions' ; import { BranchesState } from './' ; const initialState = [ ] ; export default handleActions < BranchesState , any > ( { [ Actions . FETCHED_BRANCHES ] : ( state , action ) => { return [ ... action . payload ] ; } , [ Actions . IS_FETCHING_BRANCHES ] : ( state , action ) => { return [ ... state ] ; } , [ Actions . FETCH_BRANCHES ] : ( state , action ) => { return [ ... state ] ; } , } , initialState ) ;