Created
April 30, 2017 19:21
-
-
Save santiagopoli/b78be33a72a6adbd0a54165ca1804188 to your computer and use it in GitHub Desktop.
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 clear = (favoriteId) => state => ... | |
| const fetching = (favoriteId) => state => ... | |
| const finishFetching = (favoriteId, favorite) => state => ... | |
| export default (state = {}, action) => { | |
| switch (action.type) { | |
| case 'CLEAR_FAVORITE': | |
| return clear(action.favoriteId)(state); | |
| case 'FETCHING_FAVORITE': | |
| return fetching(action.favoriteId)(state); | |
| case 'FINISH_FETCHING_FAVORITE': | |
| return finishFetching(action.favoriteId, action.favorite)(state); | |
| default: | |
| return state; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment