Merge branch 'master' of https://github.com/Microsoft/redux-dynamic-modules
This commit is contained in:
Коммит
741b09ddc8
|
@ -21,7 +21,7 @@ Modules provide the following benefits:
|
||||||
* Group together reducers, middleware, and state into a single, re-usable module.
|
* Group together reducers, middleware, and state into a single, re-usable module.
|
||||||
* Add and remove modules from a Redux store at any time.
|
* Add and remove modules from a Redux store at any time.
|
||||||
* Use the included `<DynamicModuleLoader />` component to automatically add a module when a component is rendered
|
* Use the included `<DynamicModuleLoader />` component to automatically add a module when a component is rendered
|
||||||
* Extensions provide integration with popular libraries, including `redux-saga` and `redux-observable`
|
* Extensions provide integration with popular libraries, including `redux-saga` and `redux-thunk`
|
||||||
|
|
||||||
## Example Scenarios
|
## Example Scenarios
|
||||||
* You don't want to load the code for all your reducers up front. Define a module for some reducers and use `DynamicModuleLoader` and a library like [react-loadable](https://github.com/jamiebuilds/react-loadable) to download and add your module at runtime.
|
* You don't want to load the code for all your reducers up front. Define a module for some reducers and use `DynamicModuleLoader` and a library like [react-loadable](https://github.com/jamiebuilds/react-loadable) to download and add your module at runtime.
|
||||||
|
@ -79,7 +79,7 @@ const store: IModuleStore<IState> = configureStore(
|
||||||
* Use the `DynamicModuleLoader` React component to add/remove modules when components mount/unmount
|
* Use the `DynamicModuleLoader` React component to add/remove modules when components mount/unmount
|
||||||
|
|
||||||
```jsx
|
```jsx
|
||||||
<DynamicModuleLoader modules={modules}>
|
<DynamicModuleLoader modules={[getHelloWorldModule()]}>
|
||||||
<div>Hello World!!</div>
|
<div>Hello World!!</div>
|
||||||
</DynamicModuleLoader>
|
</DynamicModuleLoader>
|
||||||
```
|
```
|
||||||
|
|
Загрузка…
Ссылка в новой задаче