Skip to main content

removeQueries()

info
  • Phương thức removeQueries() dùng để xóa query ra khỏi cache.

Cú pháp

queryClient.removeQueries(filter?: QueryFilter): void

Ví dụ

const queryClient = useQueryClient();
//Xóa query có queryKey = ['todos', 1] ra khỏi cache
queryClient.removeQueries({ queryKey: ["todos", 1] });