Skip to content

Commit 81fcf30

Browse files
[perf] make initialize & get singleton lines more explicit for vNext (#229)
1 parent b9d79df commit 81fcf30

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

perf-next/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ function intialize() {
1313

1414
// [START perf_initialize_app]
1515
// TODO: Replace the following with your app's Firebase project configuration
16-
// See: https://firebase.google.com/docs/web/setup#config-object
16+
// See: https://firebase.google.com/docs/web/learn-more#config-object
1717
const firebaseConfig = {
1818
// ...
1919
};
2020

2121
// Initialize Firebase
22-
initializeApp(firebaseConfig);
22+
const app = initializeApp(firebaseConfig);
2323
// [END perf_initialize_app]
2424

2525
// [START perf_singleton]
2626
// Initialize Performance Monitoring and get a reference to the service
27-
const perf = getPerformance();
27+
const perf = getPerformance(app);
2828
// [END perf_singleton]
2929
}
3030

perf/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const perf = firebase.performance();
1010
function intialize() {
1111
// [START perf_initialize_app]
1212
// TODO: Replace the following with your app's Firebase project configuration
13-
// See: https://firebase.google.com/docs/web/setup#config-object
13+
// See: https://firebase.google.com/docs/web/learn-more#config-object
1414
const firebaseConfig = {
1515
// ...
1616
};

snippets/perf-next/index/perf_initialize_app.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66

77
// [START perf_initialize_app_modular]
88
// TODO: Replace the following with your app's Firebase project configuration
9-
// See: https://firebase.google.com/docs/web/setup#config-object
9+
// See: https://firebase.google.com/docs/web/learn-more#config-object
1010
const firebaseConfig = {
1111
// ...
1212
};
1313

1414
// Initialize Firebase
15-
initializeApp(firebaseConfig);
15+
const app = initializeApp(firebaseConfig);
1616
// [END perf_initialize_app_modular]

snippets/perf-next/index/perf_singleton.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66

77
// [START perf_singleton_modular]
88
// Initialize Performance Monitoring and get a reference to the service
9-
const perf = getPerformance();
9+
const perf = getPerformance(app);
1010
// [END perf_singleton_modular]

0 commit comments

Comments
 (0)