Created
April 18, 2020 10:52
-
-
Save rubenmarcus/5e33d05f81c1c7f668d3eba8e302ace4 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 reducer = (state, action) => { | |
switch (action.type) { | |
case FETCH_DATA: { | |
return { | |
...state, | |
isFetching: true | |
} | |
} | |
case FETCH_DATA_SUCCESS: { | |
return { | |
...state, | |
isFetching: false, | |
data: action.payload | |
} | |
} | |
default: { | |
return state | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment