Skip to content

Commit 8946810

Browse files
committed
chore: define better step execution order
1 parent 5dbe65e commit 8946810

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

demo/app/home/home-page.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,18 @@ export function onNavigatingTo(args: NavigatedData) {
4949

5050
async function showUpdates(addListeners = false): Promise<void> {
5151
const steps: Array<() => Promise<any>> = [
52+
() => listenToActivityChanges(addListeners),
53+
() =>
54+
printCurrentLocation().catch((err) => {
55+
console.error("Could not print current location. Reason:", err);
56+
}),
5257
() =>
5358
printWifiScanResult().catch((err) => {
5459
console.error(
5560
"Could not print current nearby wifi scan. Reason:",
5661
err
5762
);
5863
}),
59-
() =>
60-
printCurrentLocation().catch((err) => {
61-
console.error("Could not print current location. Reason:", err);
62-
}),
6364
() =>
6465
printLocationUpdates()
6566
.then((subscription) => (locationSubscription = subscription))
@@ -78,7 +79,6 @@ async function showUpdates(addListeners = false): Promise<void> {
7879
err
7980
)
8081
),
81-
() => listenToActivityChanges(addListeners),
8282
];
8383
for (const step of steps) {
8484
await step();

0 commit comments

Comments
 (0)