Created
May 13, 2017 22:27
-
-
Save pixelprodev/164af1b5a05f359aa5303b8671d98a0d to your computer and use it in GitHub Desktop.
Example store index file
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 { applyMiddleware, createStore, combineReducers } from 'redux' | |
| import { composeWithDevTools } from 'redux-devtools-extension' | |
| import AccountReducer from './reducers/account' | |
| import AppReducer from './reducers/app' | |
| import BusinessUnitReducer from './reducers/businessUnit' | |
| import createSagaMiddleware from 'redux-saga' | |
| import LicenseReducer from './reducers/license' | |
| import PackageReducer from './reducers/package' | |
| import PromptReducer from './reducers/prompt' | |
| import ProvisionReducer from './reducers/provision' | |
| import ToastReducer from './reducers/toast' | |
| import rootSaga from './rootSaga' | |
| import UserReducer from './reducers/user' | |
| const reducers = combineReducers({ | |
| account: AccountReducer, | |
| app: AppReducer, | |
| businessUnit: BusinessUnitReducer, | |
| license: LicenseReducer, | |
| package: PackageReducer, | |
| prompt: PromptReducer, | |
| provision: ProvisionReducer, | |
| toast: ToastReducer, | |
| user: UserReducer | |
| }) | |
| const sagaMiddleware = createSagaMiddleware() | |
| export function generateStore (mode = process.env.NODE_ENV) { | |
| return mode === 'development' | |
| ? createStore(reducers, composeWithDevTools(applyMiddleware(sagaMiddleware))) | |
| : createStore(reducers, applyMiddleware(sagaMiddleware)) | |
| } | |
| const State = generateStore() | |
| sagaMiddleware.run(rootSaga) | |
| export default State |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Are U online. Need assistance. I am dumb - new at subject qnd totally hacked. All devives. Need assistanxe. May pay somehow