-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
It's inefficient that the metrics and sample manifest are reloaded every time the user navigates to those pages - we really should be able to just load them once when the page is loaded.
To fix this, move web/src/utils/fetchMetrics to web/src/context/Metrics.tsx and make it export:
- A hook 'useMetrics' that retrieves the metrics (or undefined before they are loaded)
- A component MetricsProvider
Similarly, extract the sample manifest reading code from web/src/components/Samples.tsx to web/src/context/SampleManifest.tsx and make it export useSampleManifest() and SampleManifestProvider.
Then use these in App.tsx so that all the pages have access to the context, and modify page components appropriately.
Metadata
Metadata
Assignees
Labels
No labels