Created
June 12, 2019 07:54
-
-
Save AlexLo33/66ef37526c15fa8c7b5186f2a446ada6 to your computer and use it in GitHub Desktop.
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 { combineReducers } from 'redux'; | |
import { createStore } from 'redux'; | |
// create reducer 1 | |
const is1 = 0; | |
const red1 = (state = is1, action) => { | |
switch(action.type) { | |
default: return state; | |
} | |
}; | |
// create reducer 2 | |
const is2 = ""; | |
const red2 = (state = is2, action) => { | |
switch(action.type) { | |
default: return state; | |
} | |
}; | |
// combine reducer 1 and 2 | |
const allRed = combineReducers({ | |
reducer1: red1, | |
reducer2: red2, | |
}); | |
// create store from combined reducers | |
const store = createStore(allRed); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment