-
-
Save reime005/9fafdf743aec6b36f8798d4b2f3de4a4 to your computer and use it in GitHub Desktop.
This file contains 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
/* 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