Last active
August 30, 2016 08:39
-
-
Save mmollaverdi/42d58b868d21607b386d05f1014ac535 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 initialState = // initial state; | |
module.exports = (state = initialState, action) => { | |
switch (action.type) { | |
case FILTER_UPDATED: // return new state containing the updated filter value | |
case FILTERS_CLEARED: // return new state reset to initial value | |
case TAB_SWITCHED: // return new state containing the location filter value from previous tab | |
case FILTERS_ROUTED: // return new state containing user's most recent location search | |
case SEARCH_HISTORY_ITEM_SELECTED: // set the state to the selected item from search history | |
default: return state; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment