Note: We also discuss useGetCallableFunction in #447, but I've left that out of this PR. After some more thought, I don't think it is worth the maintenance burden, since it is easy enough to use the Firebase JS SDK directly for that use case:
import { useFunctions } from "reactfire";
import { httpsCallable } from "firebase/functions";
function MyComponent() {
const remoteCalculator = httpsCallable(useFunctions(), "calculate");
//...
}
Description
Add the
useCallableFunctionResponse
hook, which makes it easy to call a callable function on render.fixes #447
Code sample
Note: We also discuss
useGetCallableFunction
in #447, but I've left that out of this PR. After some more thought, I don't think it is worth the maintenance burden, since it is easy enough to use the Firebase JS SDK directly for that use case: