jdalrymple / gitbeaker

🦊🧪 A comprehensive and typed Gitlab SDK for Node.js, Browsers, Deno and CLI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support using AbortController to cancel request to Gitlab?

acherkashin opened this issue · comments

Description

I make request to new Gitlab().Users.showCurrentUser() to get current user.
I have cancel button in my UI. Is it possible to use native const controller = new AbortController() to abort the request to the server?

I think it would be useful for all the methods in the libarry.

Checklist

  • I have checked that this is not a duplicate issue.
  • I have read the documentation.

That should be doable! Right now it uses AbortController under the hood to handle the queryTimeouts. I could expose it to do both query timeouts and external abort signals

@jdalrymple it would be great 👍

Follow up, would you need this on a pure request basis, or on a library config basis. Im guessing the former, but hoping the later because its easier haha

@jdalrymple Not sure how it can be implemented on library level, I think it is needed on request level.