Most reducers from libraries operate on a private store slice. The easiest way to build functionality on top of these reducers is to create a model for that store slice.
baseReducer option on a store model allows you to introduce a standard redux reducer that will compute the base state of that model. By combining this with
effects, you can create a public API over the original redux reducer. These effects can be listened for and tracked.
react-router also need middleware to work. Since we need both the model and the middleware configured with our store, the best place to do so would be a simple plugin.
This is as easy as returning a
config object that is merged into our store.
In our example,
react-router uses a
history object that we'll need to be able to pass to a
ConnectedRouter. We can expose this value for use by attaching it to our store with
Later, we can use our