How should asynchronous operations be handled when state is managed with useReducer?
Reducers must be pure, so requests and other asynchronous side effects belong outside the reducer, such as in an event handler or Effect. When the operation completes, dispatch an action containing its result so the reducer can calculate the next state.