Ad

Abort Fetching Data In Redux

- 1 answer

I have a component Preloader. It shows when I make API calls. Also this component has button "Cancel" and I want to abort all my API calls when I press this button. How can I make it?

I make requests to API using redux-effects-fetch.

Ad

Answer

redux-effects-fetch uses isomorphic-fetch, that implements whatwg-compatible Fetch API.

Request aborting now is not supported yet.

So, if you need to cancel pending request, you need to consider switching to another library. For example superagent is also isomorphic request library and has .abort().

Ad
source: stackoverflow.com
Ad