firebase / firebase-js-sdk

Firebase Javascript SDK
https://firebase.google.com/docs/web/setup
Other
4.82k stars 885 forks source link

FR: add the ability to pass abort signal to httpsCallable #3055

Open makoffd opened 4 years ago

makoffd commented 4 years ago

Describe your environment

Describe the problem

It's impossible to cancel the httpsCallable call in response to some user event e.g. button click. The proposed solution is to pass down the abort signal to the fetch invocation as described in MDN AbortSignal docs. The signal parameter could be a part of HttpsCallableOptions.

Relevant Code:

interface HttpsCallableOptions {
    timeout?: number;
    signal?: AbortSignal;
}

const controller = new AbortController();
const abortSignal = controller.signal;

functions.httpsCallable('myFirebaseFunction', {
    signal: abortSignal
});
somq commented 10 months ago

Any update on this one?