serve loader data from the cache first, update the UI when there is something new

This commit is contained in:
m5r
2022-06-05 23:11:21 +02:00
parent 5943044509
commit 724348cff4
6 changed files with 216 additions and 29 deletions

View File

@ -4,6 +4,7 @@ import { Outlet, useCatch, useMatches } from "@remix-run/react";
import serverConfig from "~/config/config.server";
import { type SessionData, requireLoggedIn } from "~/utils/auth.server";
import Footer from "~/features/core/components/footer";
import useServiceWorkerRevalidate from "~/features/core/hooks/use-service-worker-revalidate";
import footerStyles from "~/features/core/components/footer.css";
import appStyles from "~/styles/app.css";
@ -29,6 +30,7 @@ export const loader: LoaderFunction = async ({ request }) => {
};
export default function __App() {
useServiceWorkerRevalidate();
const matches = useMatches();
const hideFooter = matches.some((match) => match.handle?.hideFooter === true);

5
app/routes/dev.null.ts Normal file
View File

@ -0,0 +1,5 @@
import type { ActionFunction } from "@remix-run/node";
export const action: ActionFunction = async ({ request }) => {
return null;
};