From 8a3efd115bd1335c2a93190035b5c13dde22551a Mon Sep 17 00:00:00 2001 From: Jeff <3759507+jhuleatt@users.noreply.github.com> Date: Tue, 14 Sep 2021 14:51:49 -0400 Subject: [PATCH] httpsCallable type cleanup (#34) --- functions/index.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/functions/index.ts b/functions/index.ts index be4233a..815be3d 100644 --- a/functions/index.ts +++ b/functions/index.ts @@ -24,13 +24,13 @@ import { map } from 'rxjs/operators'; type Functions = import('firebase/functions').Functions; type HttpsCallableOptions = import('firebase/functions').HttpsCallableOptions; -export function httpsCallable( +export function httpsCallable( functions: Functions, name: string, options?: HttpsCallableOptions, -): (data: T) => Observable { - const callable = vanillaHttpsCallable(functions, name, options); - return (data: T) => { - return from(callable(data)).pipe(map(r => r.data as R)); +): (data?: RequestData | null) => Observable { + const callable = vanillaHttpsCallable(functions, name, options); + return (data) => { + return from(callable(data)).pipe(map(r => r.data)); }; }