Last active
January 1, 2020 16:44
-
-
Save duke79/d37f5aa25cc11f6d715104d00a4eea50 to your computer and use it in GitHub Desktop.
Redux in 30 seconds
This file contains hidden or 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 state = {} | |
... | |
const myReducer = ({ action, data }) => { | |
switch (action) { | |
case 'A_STRING_REPRESENTING_AN_ACTION': | |
return { | |
...state, | |
//some modifications based on 'data' | |
} | |
default: | |
return state | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment