Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop previous api calls when a new one is made #33

Open
Gebuz opened this issue Jan 17, 2023 · 1 comment
Open

Stop previous api calls when a new one is made #33

Gebuz opened this issue Jan 17, 2023 · 1 comment

Comments

@Gebuz
Copy link
Contributor

Gebuz commented Jan 17, 2023

With api calls where the response time is greater than the debounce time we can start a new call before the first has arrived, resulting in the old results arriving after the new ones. Old API calls to the same resource should be stopped when a new one is made. For instance, https://api.dataforsyningen.dk/gsearch_test/v1.0/adresse?q=frederik&limit=10 currently has a response time of ~7 seconds, but https://api.dataforsyningen.dk/gsearch_test/v1.0/adresse?q=frederik%207&limit=10 is only ~1 second.

@Gebuz Gebuz mentioned this issue Jan 17, 2023
@iamfrank
Copy link
Contributor

Det er nok et job for AbortController https://developer.mozilla.org/en-US/docs/Web/API/AbortController

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants