Skip to content

Commit 9e8ac43

Browse files
authored
Merge 955efa2 into 4e7c78b
2 parents 4e7c78b + 955efa2 commit 9e8ac43

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

packages-exp/functions-compat/src/register.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,13 @@ import {
2424
Component,
2525
ComponentType,
2626
InstanceFactory,
27-
ComponentContainer
27+
ComponentContainer,
28+
InstanceFactoryOptions
2829
} from '@firebase/component';
2930
import { Functions as FunctionsServiceExp } from '@firebase/functions-exp';
3031

32+
const DEFAULT_REGION = 'us-central1';
33+
3134
declare module '@firebase/component' {
3235
interface NameServiceMapping {
3336
'app-compat': FirebaseApp;
@@ -38,14 +41,14 @@ declare module '@firebase/component' {
3841

3942
const factory: InstanceFactory<'functions-compat'> = (
4043
container: ComponentContainer,
41-
regionOrCustomDomain?: string
44+
{ instanceIdentifier: regionOrCustomDomain }: InstanceFactoryOptions
4245
) => {
4346
// Dependencies
4447
const app = container.getProvider('app-compat').getImmediate();
4548
const functionsServiceExp = container
4649
.getProvider('functions-exp')
4750
.getImmediate({
48-
identifier: regionOrCustomDomain
51+
identifier: regionOrCustomDomain ?? DEFAULT_REGION
4952
});
5053

5154
return new FunctionsService(app, functionsServiceExp);

packages-exp/functions-exp/src/config.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ import {
2525
} from '@firebase/component';
2626
import { FUNCTIONS_TYPE } from './constants';
2727

28-
export const DEFAULT_REGION = 'us-central1';
29-
3028
export function registerFunctions(fetchImpl: typeof fetch): void {
3129
const factory: InstanceFactory<'functions'> = (
3230
container: ComponentContainer,

0 commit comments

Comments
 (0)