Epics
This chapter covers the basic setup for Dynamic Epic Injection.
Please note that epics are kept running at runtime even after the Component is unmounted.
Root Epic Setup
To enable Dynamic Epic injection, we need to create a root epic using createRootEpic
It returns us a reference to the stream containing all epics and the actual root epic we can run.
Store Configuration
After that, we need to enhance the store with applyAsyncEpics
.
We have to pass a stream of all epics epic$
so it can inject dynamically loaded epics.
The rest of configuration follows the original implementation from redux-observable.
Dynamic Epic Injection inside the Components
Now we can start injecting epics dynamically, the epic for Blog
component will be loaded along with React Component.
Last updated