fix: enhance chunk list management with new invalidation keys and imp… (#12396)
ok
This commit is contained in:
parent
147d578922
commit
34519de3b7
3 changed files with 60 additions and 25 deletions
|
|
@ -1,13 +1,15 @@
|
|||
import {
|
||||
type QueryKey,
|
||||
useQueryClient,
|
||||
} from '@tanstack/react-query'
|
||||
|
||||
export const useInvalid = (key: string[]) => {
|
||||
export const useInvalid = (key: QueryKey) => {
|
||||
const queryClient = useQueryClient()
|
||||
return () => {
|
||||
queryClient.invalidateQueries(
|
||||
{
|
||||
queryKey: key,
|
||||
})
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue