Component evidence

QueryProvider (lib/query-client.tsx)

supermemory · packages/lib/query-client.tsx · typescript · MIT
ui

Wraps React Query for efficient data fetching and caching.

Source preview first 800 characters · full source over MCP
// Source: https://github.com/supermemoryai/supermemory | License: MIT | Copyright 2025 supermemory
// Provided via justclaw.it.com; keep this notice with the code.
"use client"

import { QueryClient, QueryClientProvider } from "@tanstack/react-query"
import { ReactQueryDevtools } from "@tanstack/react-query-devtools"
import { useState } from "react"

export const QueryProvider = ({ children }: { children: React.ReactNode }) => {
	const [queryClient] = useState(
		() =>
			new QueryClient({
				defaultOptions: {
					queries: {
						refetchIntervalInBackground: false,
						refetchOnWindowFocus: false,
						staleTime: 60 * 1000,
					},
				},
			}),
	)

	return (
		<QueryClientProvider client={queryClient}>
			{children}
			<ReactQueryDevtools initialIsOpen={false} />
		</QueryClientPro

... (truncated -- full source via MCP)