(pages: Page[], url: string | null)
| 47 | } |
| 48 | |
| 49 | export function getPageFromPathname(pages: Page[], url: string | null): Page | null { |
| 50 | if (!url) { |
| 51 | return null; |
| 52 | } |
| 53 | |
| 54 | return pages.find(p => p.url === url) ?? null; |
| 55 | } |
| 56 | |
| 57 | function useDelayedSnapshot() { |
| 58 | let [delayedSnapshot, setDelayedSnapshot] = useState(getSnapshot()); |
no outgoing calls
no test coverage detected