R
R
Roman Yakimchuk2019-12-01 13:32:53
JavaScript
Roman Yakimchuk, 2019-12-01 13:32:53

How to separate work code from application state?

Friends,
Redux has one thought.
As the application grows, we will accumulate a lot of reducers, and basically they need to be loaded all at once when creating the store. If the reducer is needed only for a couple of components that are used in only one downloadable route, which the user may not open at all, there is no point in dragging it into the primary bundle and loading it right away. In addition, as more and more reducers are loaded, performance will drop.
It turns out that we need to bind actions and reducers only to components, and not put them in a common list and load everything at once. Out of the box, Redux has only one thing, this is replaceReducer, which makes it possible to replace the root reducer with a new one, for example, after loading the desired component, and this makes it possible to create the behavior we need.
There must be tools, because this is the most basic feature in the development of large applications, but the Internet is a rolling ball. I found https://github.com/ioof-holdings/redux-dynostore and https://github.com/Microsoft/redux-dynamic-modules, but somehow it's not ale at all, no support, no documentation, and judging by According to the source, this is not quite what you need.
How do you solve this problem?
Do you use something, or do you write the solution yourself?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question