| 177 | } |
| 178 | |
| 179 | async function reloadClientData() { |
| 180 | console.log('React Static: Reloading Data...') |
| 181 | // Delete all cached data |
| 182 | ;[ |
| 183 | routeInfoByPath, |
| 184 | sharedDataByHash, |
| 185 | routeErrorByPath, |
| 186 | inflightRouteInfo, |
| 187 | inflightPropHashes, |
| 188 | ].forEach(part => { |
| 189 | Object.keys(part).forEach(key => { |
| 190 | delete part[key] |
| 191 | }) |
| 192 | }) |
| 193 | |
| 194 | // Prefetch the current route's data before you reload routes |
| 195 | await prefetch(window.location.pathname) |
| 196 | |
| 197 | onReloadClientData.listeners.forEach(fn => fn()) |
| 198 | } |
| 199 | |
| 200 | export async function getRouteInfo(path, { priority } = {}) { |
| 201 | path = getRoutePath(path) |