| 1 | /** |
| 2 | * When a Customize page reads its data again: for another page, the other |
| 3 | * view, or a posted form (lib/customize.ts `needsReload`). A route export |
| 4 | * the browser runs, so it lives apart from the server-only helpers. |
| 5 | */ |
| 6 | import type { ShouldRevalidateFunctionArgs } from "react-router"; |
| 7 | |
| 8 | import { needsReload } from "./customize"; |
| 9 | |
| 10 | export function shouldRevalidate({ currentUrl, nextUrl, formMethod, defaultShouldRevalidate }: ShouldRevalidateFunctionArgs): boolean { |
| 11 | return needsReload(currentUrl, nextUrl, formMethod) ? defaultShouldRevalidate : false; |
| 12 | } |