We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
null
1 parent 146e708 commit 38c78d1Copy full SHA for 38c78d1
src/functions/useCallFunction.ts
@@ -30,10 +30,11 @@ export const useCallFunction = (
30
{ name, httpsCallableOptions }: UseCallFunctionOptions,
31
): UseCallFunction => {
32
const [state, setState] = useState<UseCallFunctionState>("ready");
33
+ const callable = httpsCallable(functions, name, httpsCallableOptions);
34
35
const invoke: UseCallFunctionInvoker = async (data: unknown = {}) => {
36
setState("loading");
- const r = httpsCallable(functions, name, httpsCallableOptions).call(data);
37
+ const r = callable(data);
38
setState("done");
39
return r;
40
};
0 commit comments