import { createStore } from 'redux' ; export type State = { count : number ; } ; export const store = createStore ( ( state = { count : 0 } , action ) => { switch ( action . type ) { case 'INCREMENT' : return { count : state . count + 1 , } ; case 'DECREMENT' : return { count : state . count - 1 , } ; default : return state ; } } , window . __REDUX_DEVTOOLS_EXTENSION__ && window . __REDUX_DEVTOOLS_EXTENSION__ ( ) ) ;