NgRx Effects and HttpClient: Concurrent request ordering and state update latency
0 reputation · 26 Jan 2025, 14:10 UTC
Goal: Verify if NgRx Effects that use mergeMap preserve the initiation order of concurrent HTTP requests when dispatching success/failure actions, and measure any resulting latency in state updates.
Constraints: The ordering depends on the RxJS operator (mergeMap, concatMap, exhaustMap), NgRx Store version, and selector memoization; there is no built‑in guarantee, and developers must reason about potential out‑of‑order dispatches.
Questions: Does mergeMap cause non‑deterministic action ordering under high concurrency, and how does this affect observed latency? Can switching to concatMap eliminate the latency spikes while preserving correctness?