Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 5 additions & 0 deletions packages/functions/src/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ export interface CallOptions<RequestData = unknown> {
* @since 6.1.0
*/
data?: RequestData | null;

/**
* Time in milliseconds after which to cancel if there is no response. Default is 70000.
*/
timeout?: number;
}

/**
Expand Down
6 changes: 6 additions & 0 deletions packages/functions/src/web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ export class FirebaseFunctionsWeb
const callable = httpsCallable<RequestData, ResponseData>(
functions,
options.name,
{
timeout: options.timeout
}
);
const result = await callable(options.data);
return {
Expand All @@ -40,6 +43,9 @@ export class FirebaseFunctionsWeb
const callable = httpsCallableFromURL<RequestData, ResponseData>(
functions,
options.url,
{
timeout: options.timeout
}
);
const result = await callable(options.data);
return {
Expand Down