This file contains hidden or 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
import {combineReducer} from "redux"; | |
import counter from "./reducerExample"; | |
/* | |
The idea is to | |
*/ | |
export default const rootReducer = combineReducer({ | |
counter | |
//, other reducers goes here with this object. | |
}); |
This file contains hidden or 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
// Example 1 with no payload | |
export function incrementCounter(){ | |
return {type:"INCREMENT_COUNTER"}; | |
} | |
/* | |
The action is only the object that is being return | |
that is: {type:"INCREMENT_COUNTER"} | |
Rest of the function is called Action creator - which creates the action | |
*/ |
NewerOlder