mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-04-23 06:09:43 +08:00
14 lines
243 B
TypeScript
14 lines
243 B
TypeScript
import {
|
|
useQueryClient,
|
|
} from '@tanstack/react-query'
|
|
|
|
export const useInvalid = (key: string[]) => {
|
|
const queryClient = useQueryClient()
|
|
return () => {
|
|
queryClient.invalidateQueries(
|
|
{
|
|
queryKey: key,
|
|
})
|
|
}
|
|
}
|