Skip to content
This repository has been archived by the owner on Sep 24, 2019. It is now read-only.

Autocomplete enhancement #53

Open
wshayes opened this issue Mar 29, 2016 · 0 comments
Open

Autocomplete enhancement #53

wshayes opened this issue Mar 29, 2016 · 0 comments

Comments

@wshayes
Copy link
Member

wshayes commented Mar 29, 2016

We can use the following information about cancelling promises to clean up the outdated autocomplete requests for the bel-term and bel-content-item fields that use autocompletes. I've put a debounce on them to limit the number of requests, but we sometimes still see out of order results come back.

From @masterpoi:
Is there some clean way to cancel a promise? I want to, when using debounce, cancel any previous outstanding http request to avoid an older request running their completion after newer requests have.
I don't want to block the input while making the http request, and i don't really want to increase the debounce duration, since basically the first request hitting the server may take +2 seconds.

To answer my own question: 
call promise.cancel: https://github.com/aurelia/http-client/blob/master/src/http-client.js#L110
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant