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
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.