Skip to content

Commit

Permalink
load routes faster (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickdemers6 authored Nov 29, 2022
1 parent 61d1332 commit 5bdd823
Show file tree
Hide file tree
Showing 3 changed files with 141 additions and 7 deletions.
138 changes: 136 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.7",
"license": "GNU3",
"scripts": {
"start": "expo start --dev-client",
"start": "expo start",
"android": "expo run:android",
"ios": "expo run:ios",
"web": "expo start --web",
Expand Down Expand Up @@ -35,7 +35,8 @@
"react-native-swipe-gestures": "^1.0.5",
"react-native-vector-icons": "^9.2.0",
"recoil": "^0.7.5",
"expo-updates": "~0.15.6"
"expo-updates": "~0.15.6",
"expo-dev-client": "~2.0.1"
},
"devDependencies": {
"@babel/core": "^7.12.9",
Expand Down
5 changes: 2 additions & 3 deletions src/state/dispatchers/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,12 @@ export const fetchRoutes =
});
set(routePatternsState, routePatterns);

let promises = [];
const promises = [];
for (const route of Object.values(routes)) {
promises.push(updateStops(routes, route.ID, set));
promises.push(updateWaypoints(routes, route.ID, set));
await Promise.all(promises);
promises = [];
}
await Promise.all(promises);
};

export const updateCurrentRoute =
Expand Down

0 comments on commit 5bdd823

Please sign in to comment.