Closed eloytoro closed 7 years ago
This is something that can be handled in "userland", outside of core Redux itself. There's a number of approaches that can be used - middleware, higher order reducers, store enhancers, etc. See http://redux.js.org/docs/faq/Actions.html#actions-multiple-actions and http://redux.js.org/docs/faq/Performance.html#performance-update-events for further info, and in particular the discussion in #1813 . My Redux addons catalog lists the various change subscription libraries out there, including an enhancer that supports dispatching arrays.
Right now redux's listeners are synchronous, this means that for every dispatch call all the listeners will trigger, and if many happen at the same time then all the listeners will trigger that same amount of times
If for example there are many dispatch calls that trigger react DOM redraw it would be much better if it only happened once since it might save itself some extra computation
Or maybe if we stack up dispatches and clear that stack in the next tick the results might be different