v5.0.0-alpha.2
This is an alpha release for Redux 5.0. This release has types changes, an internal implementation tweak, and many changes to our build and test setup.
Changelog
Store Enhancer TS Types Changes
The TS conversion in 2019 had made some changes to the definition of the StoreEnhancer TS type around replacing reducers. Some time later, we concluded that the enhancer types changes needed to be reverted, but that fell by the wayside. We've finally merged that reversion. This earlier type was never actually released publicly.
We also made an additional change to improve the typing of the next arg in enhancers.
Internal Listener Implementation
The Redux store has always used an array to track listener callbacks, and used listeners.findIndex to remove listeners on unsubscribe. As we found in React-Redux, that can have perf issues when many listeners are unsubscribing at once.
In React-Redux, we fixed that with a more sophisticated linked list approach. Here, we've updated the listeners to be stored in a Map instead, which has better delete performance than an array.
In practice this shouldn't have any real effect, because React-Redux sets up a subscription in , and all nested components subscribe to that. But, nice to fix it here as well.