Skip to content

Instantly share code, notes, and snippets.

@JiDai
Created November 21, 2017 22:57
Show Gist options
  • Save JiDai/ffa21b4dad400fbd20bfda9ea89b9dd7 to your computer and use it in GitHub Desktop.
Save JiDai/ffa21b4dad400fbd20bfda9ea89b9dd7 to your computer and use it in GitHub Desktop.
Redux reducer (JetBrains)
/**
* ${NAME}'s reducer.
* @param {String} state Existing ${NAME}'s state
* @param {Object} action Action dispatched
* @return {Object} New state
*/
export default (state = defaultState, action) => {
switch (action.type) {
case actionName:
return ;
default:
return state;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment