Advanced Redux — Side Effects, Async Tasks & ThunksEntry 8 of 9

Choosing an Async Approach

Redux offers several places for async logic; the right one depends on how complex and reused the logic is.

Notes

  • useEffect in a component: quickest, but couples the component to HTTP details. Fine for one-off cases.
  • Custom thunk: multi-step flows (notifications + request + several dispatches) shared across components.
  • createAsyncThunk: one request mapped to one slice's loading/data/error state. The default for most data fetching.
  • RTK Query (createApi): server data with caching, deduplication, and refetching built in. Replaces most hand-written fetching thunks in larger apps.
  • Redux Saga: generator-based middleware for complex workflows (cancellation, races). Rarely needed with RTK.

What / Why / When

What

A decision guide.

Why

Matching the tool to the job avoids both boilerplate and spaghetti components.

When

Before writing any new async logic.

Quick reference

NeedRedux ToolkitAngular
One-off side effectuseEffect in componentService call in component (non-store data)
Multi-step async flowCustom thunkEffect (chain actions)
One request → one state slicecreateAsyncThunkAction group + effect
Cached server dataRTK QueryhttpResource() / resource()
Complex workflowsRedux Saga / listener middlewareEffects with RxJS operators