feat: revalidate my pages breadcrumbs on demand

This commit is contained in:
Simon Emanuelsson
2024-04-16 12:42:44 +02:00
committed by Michael Zetterberg
parent ba13a00b63
commit 0c4aa592cc
24 changed files with 322 additions and 57 deletions

View File

@@ -1,7 +1,7 @@
"use client"
import { QueryClient, QueryClientProvider } from "@tanstack/react-query"
import { httpBatchLink } from "@trpc/client"
import { httpBatchLink, loggerLink } from "@trpc/client"
import { useState } from "react"
import { env } from "@/env/client"
@@ -14,7 +14,14 @@ function initializeTrpcClient() {
// that trpc and next are running on the same port.
return trpc.createClient({
links: [
loggerLink({
enabled: (opts) =>
(env.NEXT_PUBLIC_NODE_ENV === "development" &&
typeof window !== "undefined") ||
(opts.direction === "down" && opts.result instanceof Error),
}),
httpBatchLink({
fetch,
transformer,
/**
* This is locally in Next.js