mirror of
https://github.com/langgenius/dify.git
synced 2025-12-25 01:00:42 -05:00
style: refactor fetch and context (#10795)
This commit is contained in:
13
web/service/use-base.ts
Normal file
13
web/service/use-base.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import {
|
||||
useQueryClient,
|
||||
} from '@tanstack/react-query'
|
||||
|
||||
export const useInvalid = (key: string[]) => {
|
||||
const queryClient = useQueryClient()
|
||||
return () => {
|
||||
queryClient.invalidateQueries(
|
||||
{
|
||||
queryKey: key,
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user