first relase
This commit is contained in:
parent
d3a42ba6e9
commit
c6afce22ed
288 changed files with 55505 additions and 192 deletions
26
service/use-base.ts
Normal file
26
service/use-base.ts
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
import {
|
||||
type QueryKey,
|
||||
useQueryClient,
|
||||
} from '@tanstack/react-query'
|
||||
|
||||
export const useInvalid = (key: QueryKey) => {
|
||||
const queryClient = useQueryClient()
|
||||
return () => {
|
||||
queryClient.invalidateQueries(
|
||||
{
|
||||
queryKey: key,
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export const useReset = (key: QueryKey) => {
|
||||
const queryClient = useQueryClient()
|
||||
return () => {
|
||||
queryClient.resetQueries(
|
||||
{
|
||||
queryKey: key,
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue