Last active
November 11, 2017 19:55
-
-
Save mfp22/9f535dc61f483515e30f8679e8f8f57f 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
export function favoriteItemsReducer(state = initialState, action: Action) { | |
switch(action.type) { | |
case 'REMOVE_FAVORITE_ITEM': | |
case 'DELETE_ITEM_SUCCESS': | |
const itemId = action.payload; | |
return state.filter(id => id !== itemId); | |
default: | |
return state; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment