palantir / conjure-typescript-runtime

An HTTP bridge library for use in front end applications and generated conjure code
Apache License 2.0
5 stars 13 forks source link

Add AbortSignal to HTTPApiBridge and fetchBridge #134

Closed chrisjeg closed 2 years ago

chrisjeg commented 2 years ago

Before this PR

The fetch client enables users to abort a request if it is no longer required, this is especially useful if your request is for a large amount of data and also signals to the server that the request no longer needs to be fulfilled. The current conjure runtime implementation does not support a way of passing an AbortSignal to a request.

After this PR

==COMMIT_MSG== The callEndpoint method now accepts an AbortSignal signal parameter, allowing requests to be aborted from the client. ==COMMIT_MSG==

Possible downsides?

AbortController and AbortSignal are not supported by Internet Explorer, so would have to be polyfilled by those browsers in order to use this feature.

stale[bot] commented 2 years ago

This PR has been automatically marked as stale because it has not been touched in the last 14 days. If you'd like to keep it open, please leave a comment or add the 'long-lived' label, otherwise it'll be closed in 7 days.

chrisjeg commented 2 years ago

not stale

zachkirsch commented 2 years ago

+1 would love this to be merged!

stale[bot] commented 2 years ago

This PR has been automatically marked as stale because it has not been touched in the last 14 days. If you'd like to keep it open, please leave a comment or add the 'long-lived' label, otherwise it'll be closed in 7 days.