Last active
December 7, 2018 06:11
-
-
Save syamjayaraj/72ea8292a0a28c199f1872baeceed52d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const initialState = { | |
count: 0, | |
} | |
function CounterReducer (state = initialState, action){ | |
switch(action.type){ | |
case "INCREMENT_COUNT": { | |
return {...state, ...action} | |
} | |
case "DECREMENT_COUNT": { | |
return {...state, ...action} | |
} | |
default: | |
return state | |
} | |
} | |
export default CounterReducer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment