Skip to content

Instantly share code, notes, and snippets.

@reime005
Created September 8, 2019 17:11
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 reime005/9fafdf743aec6b36f8798d4b2f3de4a4 to your computer and use it in GitHub Desktop.
Save reime005/9fafdf743aec6b36f8798d4b2f3de4a4 to your computer and use it in GitHub Desktop.
/* src/store/rootReducer.js */
import { combineReducers } from "redux";
const exampleReducer = (state = { counter: 0 }, action) => {
switch (action.type) {
case TEST_INCREMENT_ACTION: {
return {
...state,
counter: state.counter + action.payload
};
}
default:
return state;
}
};
export const rootReducer = combineReducers({
exampleReducer
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment