pespantelis / vue-typeahead

:mag: Typeahead component for Vue.js
http://pespantelis.github.io/vue-typeahead
MIT License
517 stars 97 forks source link

How I can cancel the previous search you have added? #56

Open sakshigargit opened 7 years ago

sakshigargit commented 7 years ago

I have added the cancel method in my Vue file but the logic to cancel the request is not clear. I have read all the code of yours but unable to find how you are processing it.

gerciljunio commented 6 years ago

You did it? 😄

upwebdesign commented 6 years ago

When the fetch method is called, there is a race between the search being canceled and the request finishing. While this may be useful, this does not appear to abort the actual http request. For myself, this is causing lag in the search results waiting for the other requests to finish. Before attempting a pull request, I want to make sure this is accurate and the current script is NOT canceling the http request as it is now. If I am completely missing the functionality to cancel the http request, my bad.