Skip to content
This repository has been archived by the owner on Dec 8, 2021. It is now read-only.

Add the ability to abort request if it is in progress #497

Open
avsokolov opened this issue Jun 11, 2020 · 0 comments
Open

Add the ability to abort request if it is in progress #497

avsokolov opened this issue Jun 11, 2020 · 0 comments

Comments

@avsokolov
Copy link

Please, Please add the ability to abort requests.

Description

It can be implemented with AbortController. Something like

  const controller = new AbortController();
  const promise = getSdk(client, controller.signal).myQuery({...});
  setTimeout(() => consroller.abort(), 1000);
  promise.then(response => ...).catch(error => ...);

Or using rx.js Observables:

  const subsription = getSdk(client)
    .myQuery({...})
    .subsribe(response => ...);

  setTimeout(() => subsription.unsubscribe(), 1000);
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant