Created
January 30, 2018 09:24
-
-
Save mikevercoelen/dd05d870dcdcd4ca6fe331c7d2a1563a to your computer and use it in GitHub Desktop.
Login page module index.js example code
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 { injectReducer } from 'common/reducers' | |
import * as Routes from 'constants/Routes' | |
import { toggleLoader } from 'common/actions/loader' | |
export default (store) => ({ | |
path: Routes.LOGIN, | |
getComponent: async function (nextState, cb) { | |
store.dispatch(toggleLoader(true)) | |
const [module, reducer] = await Promise.all([ | |
import('./containers/LoginContainer'), | |
import('./reducers') | |
]) | |
injectReducer(store, { key: 'login', reducer: reducer.default }) | |
store.dispatch(toggleLoader(false)) | |
cb(null, module.default) | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment