TanStack Query
تسرد لوحة TanStack Query الاستعلامات والتعديلات في QueryClient الخاص بتطبيقك، وتبقيها محدّثة أثناء جلب تطبيقك
للبيانات. ويمكنك تعديل البيانات المخزنة لاستعلام، وإعادة جلب الاستعلامات أو إبطالها أو إزالتها من تطبيق سطح
المكتب.
استخدام TanStack Query في تطبيق سطح المكتب
الإعداد
Section titled “الإعداد”يقبل
false | QueryClientLike اختياريمرّر QueryClient نفسه على أنه tanstackQuery، لا كائنًا يغلّفه:
import { QueryClient } from '@tanstack/query-core';import { init } from '@xerlock/client';
const queryClient = new QueryClient();
init({ tanstackQuery: queryClient });الأشكال
Section titled “الأشكال”لا يعتمد SDK على TanStack Query. يعمل أي كائن بهذا الشكل:
| العضو | الوصف |
|---|---|
getQueryCache(): QueryCacheLike | The cache of queries. The SDK reads and subscribes to it to report queries. |
getMutationCache(): MutationCacheLike | The cache of mutations. The SDK reads and subscribes to it to report mutations. |
setQueryData(queryKey: readonly unknown[], data: unknown): unknown | Overwrites the cached data for a query. Used by the desktop app's edit action. |
refetchQueries(filters?: QueryFilterLike): Promise<void> | Refetches queries matching filters, or every query when omitted. |
invalidateQueries(filters?: QueryFilterLike): Promise<void> | Marks queries matching filters as stale and refetches active ones, or every query when omitted. |
إيقافها
Section titled “إيقافها”اترك tanstackQuery، أو مرّر false، لإخفاء لوحة TanStack Query لهذا التطبيق.
القيود واستكشاف الأخطاء وإصلاحها
Section titled “القيود واستكشاف الأخطاء وإصلاحها”- لوحة TanStack Query غير ظاهرة: مرّر
QueryClientعلى أنهtanstackQueryفيinit().