mirror of
https://github.com/langgenius/dify.git
synced 2026-05-16 16:00:26 -04:00
16 lines
387 B
TypeScript
16 lines
387 B
TypeScript
import type { QueryClient } from '@tanstack/react-query'
|
|
import { isServer } from '@/utils/client'
|
|
import { makeQueryClient } from './query-client-server'
|
|
|
|
let browserQueryClient: QueryClient | undefined
|
|
|
|
export function getQueryClient() {
|
|
if (isServer)
|
|
return makeQueryClient()
|
|
|
|
if (!browserQueryClient)
|
|
browserQueryClient = makeQueryClient()
|
|
|
|
return browserQueryClient
|
|
}
|