What are thunks and sagas? Feature Thunks (redux-thunk) Sagas (redux-saga) Concept Functions returned from
ctions
Generator-based side effects
Complexity Simple Advanced
Syntax Imperative (JS functions) Declarative (generators/yield)
Use case Basic async logic Complex flows, retries, delays
✅ Thunk example:
const fetchUser = () => (dispatch) => {
fetch("/api/user")
.then(res => res.json())
.then(data => dispatch({ type: "SET_USER", payload: data }));
};