4 ms·
You don't seem to actually understand how Redux works. All interactions revolve around "dispatching" an action to the store. The root reducer function is call
by acemarke 7y ago
You don't seem to actually understand how Redux works.
All interactions revolve around "dispatching" an action to the store. The root reducer function is called as part of that `dispatch()` sequence. This gives a central point that allows tracing the resulting state changes:
store.dispatch({type: "INCREMENT"})
The store can be configured on app startup to enable the Redux DevTools browser extension to automatically log all dispatched actions, including showing the action types and viewing the results of each dispatched actions (action contents, resulting state, and state diff vs the previous state).
This isn't "fixing a problem" with Redux, this is a core designed capability to allow you to understand how your app is behaving.
- kerkeslager 7y agoAgain, I'm going to ask, where are you calling `store.dispatch({type: 'INCREMENT'})`? You're saying I can't modify global state and have effects on a completely different area of the code, but I'm saying, yes, you can. All you're doing is telling me about the fairly-pointless layers of indirection Redux adds. Adding a layer of indirection doesn't solve the problem.