Redux dispatch lacking standardized request cancellation signals
0 reputation · 22 Nov 2021, 07:56 UTC
Redux core currently lacks a native mechanism for signaling request cancellation directly through the standard dispatch function. While middleware like Redux-Saga or Redux-Thunk provide specific patterns for managing side effects, the core store remains unaware of the lifecycle of the asynchronous operations it triggers.
In complex scenarios involving rapid action dispatches, developers must manually integrate AbortController or middleware-specific primitives to prevent race conditions. This creates a fragmented architecture where the logic for aborting a task is coupled to the middleware implementation rather than the Redux action flow itself.
Is there a proposed standard for integrating a cancellation signal into the Redux dispatch to allow for middleware-agnostic cleanup? How would a standardized signal interact with existing promise-based middleware without breaking backward compatibility with non-thunk-based architectures?