{"action":"created","issue":{"url":"https://api.github.com/repos/algolia/algoliasearch-client-js/issues/161","labels_url":"https://api.github.com/repos/algolia/algoliasearch-client-js/issues/161/labels{/name}","comments_url":"https://api.github.com/repos/algolia/algoliasearch-client-js/issues/161/comments","events_url":"https://api.github.com/repos/algolia/algoliasearch-client-js/issues/161/events","html_url":"https://github.com/algolia/algoliasearch-client-js/issues/161","id":114797512,"number":161,"title":"Is there a way to abort a search request?","user":{"login":"romaincointepas","id":797899,"avatar_url":"https://avatars.githubusercontent.com/u/797899?v=3","gravatar_id":"","url":"https://api.github.com/users/romaincointepas","html_url":"https://github.com/romaincointepas","followers_url":"https://api.github.com/users/romaincointepas/followers","following_url":"https://api.github.com/users/romaincointepas/following{/other_user}","gists_url":"https://api.github.com/users/romaincointepas/gists{/gist_id}","starred_url":"https://api.github.com/users/romaincointepas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/romaincointepas/subscriptions","organizations_url":"https://api.github.com/users/romaincointepas/orgs","repos_url":"https://api.github.com/users/romaincointepas/repos","events_url":"https://api.github.com/users/romaincointepas/events{/privacy}","received_events_url":"https://api.github.com/users/romaincointepas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-03T11:39:54Z","updated_at":"2015-11-03T12:14:38Z","closed_at":null,"body":"Useful when connectivity is bad and search results don't come back nearly instantly.\r\n\r\nUser search for something, we call index.search(), then the user do something that would make the search results obsolete (navigates away?). In this case it would be good to have a way to abort the current request (and index.search callback would either never be called or be called with an error)."},"comment":{"url":"https://api.github.com/repos/algolia/algoliasearch-client-js/issues/comments/153335452","html_url":"https://github.com/algolia/algoliasearch-client-js/issues/161#issuecomment-153335452","issue_url":"https://api.github.com/repos/algolia/algoliasearch-client-js/issues/161","id":153335452,"user":{"login":"vvo","id":123822,"avatar_url":"https://avatars.githubusercontent.com/u/123822?v=3","gravatar_id":"","url":"https://api.github.com/users/vvo","html_url":"https://github.com/vvo","followers_url":"https://api.github.com/users/vvo/followers","following_url":"https://api.github.com/users/vvo/following{/other_user}","gists_url":"https://api.github.com/users/vvo/gists{/gist_id}","starred_url":"https://api.github.com/users/vvo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vvo/subscriptions","organizations_url":"https://api.github.com/users/vvo/orgs","repos_url":"https://api.github.com/users/vvo/repos","events_url":"https://api.github.com/users/vvo/events{/privacy}","received_events_url":"https://api.github.com/users/vvo/received_events","type":"User","site_admin":false},"created_at":"2015-11-03T12:14:38Z","updated_at":"2015-11-03T12:14:38Z","body":"> and ignoring the results when they come back.\r\n\r\nYes\r\n\r\n> Is it cancelled?\r\n\r\nSo no it's not because from the POV of an API client we try to be close to a simple request/response library.\r\n\r\nHandling outdated answers is the goal of our https://github.com/algolia/algoliasearch-helper-js that you should use if you are building an instant search result page.\r\n\r\nBut even that, right now the helper is not actively cancelling the requests. Maybe we could, I am not sure.\r\n\r\n@bobylito I cannot exactly recall when do we discard response in the helper. Can you write it down here (and then we add it to the helper doc)."}}