+1 vote
by
Let's say there are 10 redirectors. One of them reacts to action.type ADD_ITEM

So when you call this action (ADD_ITEM), the redactor goes through all the redactors and if there is a switch-case on ADD_ITEM, it processes something, but if not, it just returns the state?
I.e., every time you call any action, the redux keeps bypassing all reduxers completely?

2 Answers

0 votes
by
 
Best answer
does redux always bypass all redusers completely?

Exactly. There is a lot of unnecessary stuff in the example, because it is forked from the full official one, but note that any action has two entries in the console, one from each redirector: https://codesandbox.io/s/ecstatic-night-yv27q

But fear not, it does not affect the apparent speed of the application.
+1 vote
by
and if not, just give it back? - Yes.

i.e., every time you call any action, the redux keeps bypassing all reduxers completely? - no
action goes to its redirector and changes are made
by
action brothers go to their editors
How?
by
Alexei Ukolov , calls it as a normal function
by
I read not only the documentation, but also the source code. And what you wrote does not match them, so I'm trying to understand - is it something I do not understand, or you wrote something wrong. How, for example, in the scheme of "action calls its reduser" fit middleswares? Why can one event be handled in several redusers?

And why does the documentation say the following, if it is the action that selects which redirector to call?
The logic inside reducer functions typically follows the same series of steps:Check to see if the reducer cares about this actionIf so, make a copy of the state, update the copy with new values, and return itOtherwise, return the existing state unchanged
The Redux store has a method called dispatch. The only way to update the state is to call store.dispatch() and pass in an action object. The store will run its reducer function and save the new state value inside

The resulting reducer calls every child reducer, and gathers their results into a single state object. The state produced by combineReducers() namespaces the states of each reducer under their keys as passed to combineReducers()
by
How does the action know which function to call? What mechanisms does a simple js object use to call a function?
by
How does the action know which function to call? What mechanisms does a simple js object use to call a function?
...