React · Senior · Question 31 of 75

What is createListenerMiddleware in Redux Toolkit for?

Explanation

Listener middleware is a lightweight alternative to redux-saga and redux-observable: startListening({ actionCreator: todoAdded, effect: async (action, api) => {...} }). You can wait for other actions (take), cancel tasks, debounce, and work with state before and after the action.

Further reading

Problem with a question

React · Senior · question 31

Test yourself

Take the React · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz