From 01ab59d6801e4d5fdea3313bd163ffc7966cd00f Mon Sep 17 00:00:00 2001 From: NothingEverHappens Date: Wed, 29 Apr 2020 13:40:38 -0400 Subject: [PATCH] feat(functions): Add options param to httpsCallable functions fix #2433 I don't see a good way to test it without a big refactoring, open to suggestions. --- src/functions/functions.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/functions/functions.ts b/src/functions/functions.ts index d767577a7..b3ad29fa5 100644 --- a/src/functions/functions.ts +++ b/src/functions/functions.ts @@ -4,6 +4,7 @@ import { map, switchMap, shareReplay, tap, observeOn } from 'rxjs/operators'; import { FirebaseOptions, FirebaseAppConfig, FIREBASE_APP_NAME, ɵlazySDKProxy, ɵPromiseProxy, ɵAngularFireSchedulers } from '@angular/fire'; import { FIREBASE_OPTIONS, ɵfirebaseAppFactory } from '@angular/fire'; import { functions } from 'firebase/app'; +import { HttpsCallableOptions } from '@firebase/functions-types'; export const ORIGIN = new InjectionToken('angularfire2.functions.origin'); export const REGION = new InjectionToken('angularfire2.functions.region'); @@ -38,12 +39,12 @@ export class AngularFireFunctions { shareReplay({ bufferSize: 1, refCount: false }), ); - this.httpsCallable = (name: string) => + this.httpsCallable = (name: string, options?: HttpsCallableOptions) => (data: T) => from(functions).pipe( observeOn(schedulers.outsideAngular), - switchMap(functions => functions.httpsCallable(name)(data)), + switchMap(functions => functions.httpsCallable(name, options)(data)), map(r => r.data as R) - ) + ); return ɵlazySDKProxy(this, functions, zone);