const reducer = ( state = 0, action ) => { switch(action.type){ case "INCREMENT": return state + 1 case "DECREMENT": return state - 1 default: return state } } // when createStore is called with a reducer function, it returns 4 methods. We will just create the empty methods now as a first. function createStore(reducer){ function getState(){ } function dispatch(){ } function subscribe(){ // invoking this returned function will remove the subscriber function return function(){ } } return { getState: getState, dispatch: dispatch, subscribe: subscribe, } }