تخطَّ إلى المحتوى
العربية

TanStack Query

تسرد لوحة TanStack Query الاستعلامات والتعديلات في QueryClient الخاص بتطبيقك، وتبقيها محدّثة أثناء جلب تطبيقك للبيانات. ويمكنك تعديل البيانات المخزنة لاستعلام، وإعادة جلب الاستعلامات أو إبطالها أو إزالتها من تطبيق سطح المكتب.

استخدام TanStack Query في تطبيق سطح المكتب

يقبل false | QueryClientLike اختياري

مرّر QueryClient نفسه على أنه tanstackQuery، لا كائنًا يغلّفه:

index.ts
import { QueryClient } from '@tanstack/query-core';
import { init } from '@xerlock/client';
const queryClient = new QueryClient();
init({ tanstackQuery: queryClient });

لا يعتمد SDK على TanStack Query. يعمل أي كائن بهذا الشكل:

QueryClientLike
العضوالوصف
getQueryCache(): QueryCacheLikeThe cache of queries. The SDK reads and subscribes to it to report queries.
getMutationCache(): MutationCacheLikeThe cache of mutations. The SDK reads and subscribes to it to report mutations.
setQueryData(queryKey: readonly unknown[], data: unknown): unknownOverwrites 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.

اترك tanstackQuery، أو مرّر false، لإخفاء لوحة TanStack Query لهذا التطبيق.

القيود واستكشاف الأخطاء وإصلاحها

Section titled “القيود واستكشاف الأخطاء وإصلاحها”
  • لوحة TanStack Query غير ظاهرة: مرّر QueryClient على أنه tanstackQuery في init().