Created
November 30, 2021 13:36
-
-
Save Sidnioulz/901286677580c67263dc5783fd7cdc80 to your computer and use it in GitHub Desktop.
Redux Dynamic Modules example
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
import { DynamicModuleLoader } from 'redux-dynamic-modules' | |
import React from 'react' | |
import { startup } from 'modules/auth/actions/authActions' | |
import authReducer from 'modules/auth/reducers/authReducer' | |
import redirectReducer from 'modules/redirect/reducers/redirectReducer' | |
import authSaga from 'modules/auth/sagas/authSaga' | |
import redirectSaga from 'modules/redirect/sagas/redirectSaga' | |
import sharedSaga from 'shared/sagas' | |
import AuthPage from 'modules/auth/components/AuthPage' | |
export const moduleConfig = { | |
id: 'auth', | |
reducerMap: { | |
auth: authReducer, | |
redirect: redirectReducer, | |
}, | |
sagas: [sharedSaga, redirectSaga, authSaga], | |
initialActions: [startup()], | |
} | |
const AuthModule = (props) => { | |
return ( | |
<DynamicModuleLoader modules={[moduleConfig]}> | |
<AuthPage {...props} /> | |
</DynamicModuleLoader> | |
) | |
} | |
export default AuthModule |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment