Skip to content

Commit f8d5a50

Browse files
feat(functions): Add options param to httpsCallable functions (#2434)
closes #2433 Co-authored-by: James Daniels <jamesdaniels@google.com>
1 parent fe31191 commit f8d5a50

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/functions/functions.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
} from '@angular/fire';
1515
import firebase from 'firebase/app';
1616
import { proxyPolyfillCompat } from './base';
17+
import { HttpsCallableOptions } from '@firebase/functions-types';
1718

1819
export const ORIGIN = new InjectionToken<string>('angularfire2.functions.origin');
1920
export const REGION = new InjectionToken<string>('angularfire2.functions.region');
@@ -51,10 +52,10 @@ export class AngularFireFunctions {
5152
shareReplay({ bufferSize: 1, refCount: false })
5253
);
5354

54-
this.httpsCallable = <T = any, R = any>(name: string) =>
55+
this.httpsCallable = <T = any, R = any>(name: string, options?: HttpsCallableOptions) =>
5556
(data: T) => from(functions).pipe(
5657
observeOn(schedulers.insideAngular),
57-
switchMap(functions => functions.httpsCallable(name)(data)),
58+
switchMap(functions => functions.httpsCallable(name, options)(data)),
5859
map(r => r.data as R)
5960
);
6061

0 commit comments

Comments
 (0)