import { Reducer } from 'react' ; export enum SidebarActionTypes { TOGGLE = 'sidebar/toggle' } export interface SidebarAction { type : SidebarActionTypes . TOGGLE ; } const sidebarReducer = ( state = true , action ) : boolean => { if ( action . type === SidebarActionTypes . TOGGLE ) { return ! state ; } return state ; } ; export default sidebarReducer ;