Skip to content

Commit

Permalink
Add positional parameters to Functions hooks (#80)
Browse files Browse the repository at this point in the history
* sync functions dependencies

* make functions a positional parameter

* update docs
  • Loading branch information
erayerdin authored Feb 18, 2024
1 parent 8511bd0 commit e1c5821
Show file tree
Hide file tree
Showing 4 changed files with 1,288 additions and 658 deletions.
7 changes: 4 additions & 3 deletions docs/hooks/useCallFunction.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ tags:
`useCallFunction` hook is used to invoke a function in Firebase Functions. A very simple example would be:

```typescript
const { invoke } = useCallFunction({ functions, name: "yourFunctionName" });
const { invoke } = useCallFunction(functions, { name: "yourFunctionName" });
const result = await invoke({
// ... request data to send ...
});
Expand All @@ -35,8 +35,9 @@ Input parameters for `useCallFunction` hook is as follows:
| Name | Type | Description | Required | Default Value |
|---|---|---|---|---|
| `functions` | [`firebase/functions/Functions`][FunctionsRefDoc] | Reference to the Firebase Functions service instance. || - |
| `name` | `string` | The name of the function to be called. || - |
| `httpsCallableOptions` | [`firebase/functions/HttpsCallableOptions`][HttpsCallableOptionsRefDoc] | The options for callable. || `undefined` |
| `options` | `Object` | Options for the process. || See below. |
| `options.name` | `string` | The name of the function to be called. || - |
| `options.httpsCallableOptions` | [`firebase/functions/HttpsCallableOptions`][HttpsCallableOptionsRefDoc] | The options for callable. || `undefined` |

## Return Type

Expand Down
Loading

0 comments on commit e1c5821

Please sign in to comment.