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