Skip to content

Instantly share code, notes, and snippets.

@rishichawda
Last active May 18, 2019 19:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rishichawda/46865557e94f06f3f9dfcf845cfb6b37 to your computer and use it in GitHub Desktop.
Save rishichawda/46865557e94f06f3f9dfcf845cfb6b37 to your computer and use it in GitHub Desktop.
Initial reducer.js file - Managing Application state without Redux
export default (state, action) => {
switch (action.type) {
case 'increment':
return {
...state,
count: state.count + 1,
};
default:
return state;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment