OpenBEL / belmgr

Website for managing BEL Evidences - based on Aurelia. Requires the OpenBEL Platform for the backend API/storage.
Apache License 2.0
2 stars 4 forks source link

Autocomplete enhancement #53

Open wshayes opened 8 years ago

wshayes commented 8 years ago

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