State Management · Senior · Question 10 of 75
What is createListenerMiddleware for?
- ✓Correct answer: Running side effects in response to specific actions or state changes
- 2Subscribing React components to individual store fields
- 3Converting DOM events into Redux actions
Explanation
A lightweight alternative to sagas: startListening({ actionCreator: todoAdded, effect: async (action, api) => {...} }). Effects can wait for other actions (take), cancel, debounce and read state before/after.