MCPcopy Create free account
hub / github.com/react-static/react-static / reloadClientData

Function reloadClientData

packages/react-static/src/browser/index.js:179–198  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

177}
178
179async 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
200export async function getRouteInfo(path, { priority } = {}) {
201 path = getRoutePath(path)

Callers 1

runFunction · 0.70

Calls 1

prefetchFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…