Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1882

How to handle expired http requests in Svelte?

$
0
0

The way I have it set up is a class that handles all the api calls. In this class I keep a map for GET requests, key is url, value is AbortController.

If a request is being sent and another one of the same type comes before the other has finished, then I call abort() on the prev one and honor the new one.

Problem is that I get many uncaught exceptions on svelte effects when signal is aborted, and adding try/catch everywhere would be a lot of hassle.

Are there better ay to handle this? In React there is reactquery, but I prefer not to use some external library if possible


Viewing all articles
Browse latest Browse all 1882

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>