Configuring slice‑specific filtering for Redux store subscriptions
0 reputation · 28 Feb 2020, 15:43 UTC
Goal: Configure a Redux store so that subscription listeners are invoked only when a specific slice of the state tree changes, eliminating the need for manual equality checks inside each listener.
Constraint: Core Redux’s store.subscribe notifies listeners on every dispatch, regardless of whether the returned state reference or the targeted slice has changed, and there is no built‑in option to filter notifications by slice or to suppress calls when the slice is unchanged.
Uncertainty: While community middleware such as redux‑batched‑subscriptions or custom store enhancers can add slice‑specific filtering, it is unclear whether an official or recommended pattern exists for this behavior, or if future releases plan to incorporate it directly into the store API.
Questions: What official or community‑endorsed approaches provide slice‑specific subscription filtering without requiring listeners to perform their own equality checks? Is there any plan to add native slice‑filtering capabilities to Redux’s core store subscription mechanism?