Problem Statement
What is middleware in Redux and why is it important?
Explanation
Middleware acts as a layer between dispatching an action and reaching the reducer.
It is used for logging, asynchronous operations (like Redux Thunk or Saga), and side-effects such as API calls. This keeps reducers pure and predictable.