Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/functions/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string>('angularfire2.functions.origin');
export const REGION = new InjectionToken<string>('angularfire2.functions.region');
Expand Down Expand Up @@ -38,12 +39,12 @@ export class AngularFireFunctions {
shareReplay({ bufferSize: 1, refCount: false }),
);

this.httpsCallable = <T=any, R=any>(name: string) =>
this.httpsCallable = <T = any, R = any>(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);

Expand Down