Skip to content

Instantly share code, notes, and snippets.

@mmollaverdi
Last active August 30, 2016 08:39
Show Gist options
  • Save mmollaverdi/42d58b868d21607b386d05f1014ac535 to your computer and use it in GitHub Desktop.
Save mmollaverdi/42d58b868d21607b386d05f1014ac535 to your computer and use it in GitHub Desktop.
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