@tanstack/query-core 5.15.5 → 5.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/legacy/hydration.d.cts +1 -1
- package/build/legacy/hydration.d.ts +1 -1
- package/build/legacy/index.d.cts +1 -1
- package/build/legacy/index.d.ts +1 -1
- package/build/legacy/infiniteQueryBehavior.d.cts +1 -1
- package/build/legacy/infiniteQueryBehavior.d.ts +1 -1
- package/build/legacy/infiniteQueryObserver.d.cts +1 -1
- package/build/legacy/infiniteQueryObserver.d.ts +1 -1
- package/build/legacy/mutation.d.cts +1 -1
- package/build/legacy/mutation.d.ts +1 -1
- package/build/legacy/mutationCache.d.cts +1 -1
- package/build/legacy/mutationCache.d.ts +1 -1
- package/build/legacy/mutationObserver.d.cts +1 -1
- package/build/legacy/mutationObserver.d.ts +1 -1
- package/build/legacy/notifyManager.cjs +8 -4
- package/build/legacy/notifyManager.cjs.map +1 -1
- package/build/legacy/notifyManager.d.cts +3 -0
- package/build/legacy/notifyManager.d.ts +3 -0
- package/build/legacy/notifyManager.js +8 -4
- package/build/legacy/notifyManager.js.map +1 -1
- package/build/legacy/queriesObserver.d.cts +1 -1
- package/build/legacy/queriesObserver.d.ts +1 -1
- package/build/legacy/query.d.cts +1 -1
- package/build/legacy/query.d.ts +1 -1
- package/build/legacy/queryCache.d.cts +1 -1
- package/build/legacy/queryCache.d.ts +1 -1
- package/build/legacy/{queryClient-ztzbWIOA.d.cts → queryClient-ZM0hKLC_.d.cts} +1 -6
- package/build/legacy/{queryClient-j9i6YgPc.d.ts → queryClient-mVGWb1w6.d.ts} +1 -6
- package/build/legacy/queryClient.d.cts +1 -1
- package/build/legacy/queryClient.d.ts +1 -1
- package/build/legacy/queryObserver.d.cts +1 -1
- package/build/legacy/queryObserver.d.ts +1 -1
- package/build/legacy/retryer.d.cts +1 -1
- package/build/legacy/retryer.d.ts +1 -1
- package/build/legacy/types.d.cts +1 -1
- package/build/legacy/types.d.ts +1 -1
- package/build/legacy/utils.cjs +0 -5
- package/build/legacy/utils.cjs.map +1 -1
- package/build/legacy/utils.d.cts +1 -1
- package/build/legacy/utils.d.ts +1 -1
- package/build/legacy/utils.js +0 -4
- package/build/legacy/utils.js.map +1 -1
- package/build/modern/hydration.d.cts +1 -1
- package/build/modern/hydration.d.ts +1 -1
- package/build/modern/index.d.cts +1 -1
- package/build/modern/index.d.ts +1 -1
- package/build/modern/infiniteQueryBehavior.d.cts +1 -1
- package/build/modern/infiniteQueryBehavior.d.ts +1 -1
- package/build/modern/infiniteQueryObserver.d.cts +1 -1
- package/build/modern/infiniteQueryObserver.d.ts +1 -1
- package/build/modern/mutation.d.cts +1 -1
- package/build/modern/mutation.d.ts +1 -1
- package/build/modern/mutationCache.d.cts +1 -1
- package/build/modern/mutationCache.d.ts +1 -1
- package/build/modern/mutationObserver.d.cts +1 -1
- package/build/modern/mutationObserver.d.ts +1 -1
- package/build/modern/notifyManager.cjs +8 -4
- package/build/modern/notifyManager.cjs.map +1 -1
- package/build/modern/notifyManager.d.cts +3 -0
- package/build/modern/notifyManager.d.ts +3 -0
- package/build/modern/notifyManager.js +8 -4
- package/build/modern/notifyManager.js.map +1 -1
- package/build/modern/queriesObserver.d.cts +1 -1
- package/build/modern/queriesObserver.d.ts +1 -1
- package/build/modern/query.d.cts +1 -1
- package/build/modern/query.d.ts +1 -1
- package/build/modern/queryCache.d.cts +1 -1
- package/build/modern/queryCache.d.ts +1 -1
- package/build/modern/{queryClient-ztzbWIOA.d.cts → queryClient-ZM0hKLC_.d.cts} +1 -6
- package/build/modern/{queryClient-j9i6YgPc.d.ts → queryClient-mVGWb1w6.d.ts} +1 -6
- package/build/modern/queryClient.d.cts +1 -1
- package/build/modern/queryClient.d.ts +1 -1
- package/build/modern/queryObserver.d.cts +1 -1
- package/build/modern/queryObserver.d.ts +1 -1
- package/build/modern/retryer.d.cts +1 -1
- package/build/modern/retryer.d.ts +1 -1
- package/build/modern/types.d.cts +1 -1
- package/build/modern/types.d.ts +1 -1
- package/build/modern/utils.cjs +0 -5
- package/build/modern/utils.cjs.map +1 -1
- package/build/modern/utils.d.cts +1 -1
- package/build/modern/utils.d.ts +1 -1
- package/build/modern/utils.js +0 -4
- package/build/modern/utils.js.map +1 -1
- package/package.json +2 -2
- package/src/notifyManager.ts +10 -4
- package/src/tests/notifyManager.test.tsx +19 -1
- package/src/tests/utils.test.tsx +1 -14
- package/src/utils.ts +0 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils.ts"],"sourcesContent":["import type { Mutation } from './mutation'\nimport type { Query } from './query'\nimport type {\n FetchStatus,\n MutationKey,\n MutationStatus,\n QueryKey,\n QueryOptions,\n} from './types'\n\n// TYPES\n\nexport interface QueryFilters {\n /**\n * Filter to active queries, inactive queries or all queries\n */\n type?: QueryTypeFilter\n /**\n * Match query key exactly\n */\n exact?: boolean\n /**\n * Include queries matching this predicate function\n */\n predicate?: (query: Query) => boolean\n /**\n * Include queries matching this query key\n */\n queryKey?: QueryKey\n /**\n * Include or exclude stale queries\n */\n stale?: boolean\n /**\n * Include queries matching their fetchStatus\n */\n fetchStatus?: FetchStatus\n}\n\nexport interface MutationFilters {\n /**\n * Match mutation key exactly\n */\n exact?: boolean\n /**\n * Include mutations matching this predicate function\n */\n predicate?: (mutation: Mutation<any, any, any>) => boolean\n /**\n * Include mutations matching this mutation key\n */\n mutationKey?: MutationKey\n /**\n * Filter by mutation status\n */\n status?: MutationStatus\n}\n\nexport type Updater<TInput, TOutput> = TOutput | ((input: TInput) => TOutput)\n\nexport type QueryTypeFilter = 'all' | 'active' | 'inactive'\n\n// UTILS\n\nexport const isServer = typeof window === 'undefined' || 'Deno' in window\n\nexport function noop(): undefined {\n return undefined\n}\n\nexport function functionalUpdate<TInput, TOutput>(\n updater: Updater<TInput, TOutput>,\n input: TInput,\n): TOutput {\n return typeof updater === 'function'\n ? (updater as (_: TInput) => TOutput)(input)\n : updater\n}\n\nexport function isValidTimeout(value: unknown): value is number {\n return typeof value === 'number' && value >= 0 && value !== Infinity\n}\n\nexport function timeUntilStale(updatedAt: number, staleTime?: number): number {\n return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0)\n}\n\nexport function matchQuery(\n filters: QueryFilters,\n query: Query<any, any, any, any>,\n): boolean {\n const {\n type = 'all',\n exact,\n fetchStatus,\n predicate,\n queryKey,\n stale,\n } = filters\n\n if (queryKey) {\n if (exact) {\n if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) {\n return false\n }\n } else if (!partialMatchKey(query.queryKey, queryKey)) {\n return false\n }\n }\n\n if (type !== 'all') {\n const isActive = query.isActive()\n if (type === 'active' && !isActive) {\n return false\n }\n if (type === 'inactive' && isActive) {\n return false\n }\n }\n\n if (typeof stale === 'boolean' && query.isStale() !== stale) {\n return false\n }\n\n if (\n typeof fetchStatus !== 'undefined' &&\n fetchStatus !== query.state.fetchStatus\n ) {\n return false\n }\n\n if (predicate && !predicate(query)) {\n return false\n }\n\n return true\n}\n\nexport function matchMutation(\n filters: MutationFilters,\n mutation: Mutation<any, any>,\n): boolean {\n const { exact, status, predicate, mutationKey } = filters\n if (mutationKey) {\n if (!mutation.options.mutationKey) {\n return false\n }\n if (exact) {\n if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) {\n return false\n }\n } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) {\n return false\n }\n }\n\n if (status && mutation.state.status !== status) {\n return false\n }\n\n if (predicate && !predicate(mutation)) {\n return false\n }\n\n return true\n}\n\nexport function hashQueryKeyByOptions<TQueryKey extends QueryKey = QueryKey>(\n queryKey: TQueryKey,\n options?: QueryOptions<any, any, any, TQueryKey>,\n): string {\n const hashFn = options?.queryKeyHashFn || hashKey\n return hashFn(queryKey)\n}\n\n/**\n * Default query & mutation keys hash function.\n * Hashes the value into a stable hash.\n */\nexport function hashKey(queryKey: QueryKey | MutationKey): string {\n return JSON.stringify(queryKey, (_, val) =>\n isPlainObject(val)\n ? Object.keys(val)\n .sort()\n .reduce((result, key) => {\n result[key] = val[key]\n return result\n }, {} as any)\n : val,\n )\n}\n\n/**\n * Checks if key `b` partially matches with key `a`.\n */\nexport function partialMatchKey(a: QueryKey, b: QueryKey): boolean\nexport function partialMatchKey(a: any, b: any): boolean {\n if (a === b) {\n return true\n }\n\n if (typeof a !== typeof b) {\n return false\n }\n\n if (a && b && typeof a === 'object' && typeof b === 'object') {\n return !Object.keys(b).some((key) => !partialMatchKey(a[key], b[key]))\n }\n\n return false\n}\n\n/**\n * This function returns `a` if `b` is deeply equal.\n * If not, it will replace any deeply equal children of `b` with those of `a`.\n * This can be used for structural sharing between JSON values for example.\n */\nexport function replaceEqualDeep<T>(a: unknown, b: T): T\nexport function replaceEqualDeep(a: any, b: any): any {\n if (a === b) {\n return a\n }\n\n const array = isPlainArray(a) && isPlainArray(b)\n\n if (array || (isPlainObject(a) && isPlainObject(b))) {\n const aSize = array ? a.length : Object.keys(a).length\n const bItems = array ? b : Object.keys(b)\n const bSize = bItems.length\n const copy: any = array ? [] : {}\n\n let equalItems = 0\n\n for (let i = 0; i < bSize; i++) {\n const key = array ? i : bItems[i]\n copy[key] = replaceEqualDeep(a[key], b[key])\n if (copy[key] === a[key]) {\n equalItems++\n }\n }\n\n return aSize === bSize && equalItems === aSize ? a : copy\n }\n\n return b\n}\n\n/**\n * Shallow compare objects. Only works with objects that always have the same properties.\n */\nexport function shallowEqualObjects<T>(a: T, b: T): boolean {\n if ((a && !b) || (b && !a)) {\n return false\n }\n\n for (const key in a) {\n if (a[key] !== b[key]) {\n return false\n }\n }\n\n return true\n}\n\nexport function isPlainArray(value: unknown) {\n return Array.isArray(value) && value.length === Object.keys(value).length\n}\n\n// Copied from: https://github.com/jonschlinkert/is-plain-object\nexport function isPlainObject(o: any): o is Object {\n if (!hasObjectPrototype(o)) {\n return false\n }\n\n // If has no constructor\n const ctor = o.constructor\n if (typeof ctor === 'undefined') {\n return true\n }\n\n // If has modified prototype\n const prot = ctor.prototype\n if (!hasObjectPrototype(prot)) {\n return false\n }\n\n // If constructor does not have an Object-specific method\n if (!prot.hasOwnProperty('isPrototypeOf')) {\n return false\n }\n\n // Most likely a plain Object\n return true\n}\n\nfunction hasObjectPrototype(o: any): boolean {\n return Object.prototype.toString.call(o) === '[object Object]'\n}\n\nexport function sleep(ms: number): Promise<void> {\n return new Promise((resolve) => {\n setTimeout(resolve, ms)\n })\n}\n\n/**\n * Schedules a microtask.\n * This can be useful to schedule state updates after rendering.\n */\nexport function scheduleMicrotask(callback: () => void) {\n sleep(0).then(callback)\n}\n\nexport function replaceData<\n TData,\n TOptions extends QueryOptions<any, any, any, any>,\n>(prevData: TData | undefined, data: TData, options: TOptions): TData {\n if (typeof options.structuralSharing === 'function') {\n return options.structuralSharing(prevData, data)\n } else if (options.structuralSharing !== false) {\n // Structurally share data between prev and new data if needed\n return replaceEqualDeep(prevData, data)\n }\n return data\n}\n\nexport function keepPreviousData<T>(\n previousData: T | undefined,\n): T | undefined {\n return previousData\n}\n\nexport function addToEnd<T>(items: Array<T>, item: T, max = 0): Array<T> {\n const newItems = [...items, item]\n return max && newItems.length > max ? newItems.slice(1) : newItems\n}\n\nexport function addToStart<T>(items: Array<T>, item: T, max = 0): Array<T> {\n const newItems = [item, ...items]\n return max && newItems.length > max ? newItems.slice(0, -1) : newItems\n}\n"],"mappings":";;;AAgEO,IAAM,WAAW,OAAO,WAAW,eAAe,UAAU;AAE5D,SAAS,OAAkB;AAChC,SAAO;AACT;AAEO,SAAS,iBACd,SACA,OACS;AACT,SAAO,OAAO,YAAY,aACrB,QAAmC,KAAK,IACzC;AACN;AAEO,SAAS,eAAe,OAAiC;AAC9D,SAAO,OAAO,UAAU,YAAY,SAAS,KAAK,UAAU;AAC9D;AAEO,SAAS,eAAe,WAAmB,WAA4B;AAC5E,SAAO,KAAK,IAAI,aAAa,aAAa,KAAK,KAAK,IAAI,GAAG,CAAC;AAC9D;AAEO,SAAS,WACd,SACA,OACS;AACT,QAAM;AAAA,IAC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C,WAAO,iBAAiB,UAAU,IAAI;AAAA,EACxC;AACA,SAAO;AACT;AAEO,SAAS,iBACd,cACe;AACf,SAAO;AACT;AAEO,SAAS,SAAY,OAAiB,MAAS,MAAM,GAAa;AACvE,QAAM,WAAW,CAAC,GAAG,OAAO,IAAI;AAChC,SAAO,OAAO,SAAS,SAAS,MAAM,SAAS,MAAM,CAAC,IAAI;AAC5D;AAEO,SAAS,WAAc,OAAiB,MAAS,MAAM,GAAa;AACzE,QAAM,WAAW,CAAC,MAAM,GAAG,KAAK;AAChC,SAAO,OAAO,SAAS,SAAS,MAAM,SAAS,MAAM,GAAG,EAAE,IAAI;AAChE;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/utils.ts"],"sourcesContent":["import type { Mutation } from './mutation'\nimport type { Query } from './query'\nimport type {\n FetchStatus,\n MutationKey,\n MutationStatus,\n QueryKey,\n QueryOptions,\n} from './types'\n\n// TYPES\n\nexport interface QueryFilters {\n /**\n * Filter to active queries, inactive queries or all queries\n */\n type?: QueryTypeFilter\n /**\n * Match query key exactly\n */\n exact?: boolean\n /**\n * Include queries matching this predicate function\n */\n predicate?: (query: Query) => boolean\n /**\n * Include queries matching this query key\n */\n queryKey?: QueryKey\n /**\n * Include or exclude stale queries\n */\n stale?: boolean\n /**\n * Include queries matching their fetchStatus\n */\n fetchStatus?: FetchStatus\n}\n\nexport interface MutationFilters {\n /**\n * Match mutation key exactly\n */\n exact?: boolean\n /**\n * Include mutations matching this predicate function\n */\n predicate?: (mutation: Mutation<any, any, any>) => boolean\n /**\n * Include mutations matching this mutation key\n */\n mutationKey?: MutationKey\n /**\n * Filter by mutation status\n */\n status?: MutationStatus\n}\n\nexport type Updater<TInput, TOutput> = TOutput | ((input: TInput) => TOutput)\n\nexport type QueryTypeFilter = 'all' | 'active' | 'inactive'\n\n// UTILS\n\nexport const isServer = typeof window === 'undefined' || 'Deno' in window\n\nexport function noop(): undefined {\n return undefined\n}\n\nexport function functionalUpdate<TInput, TOutput>(\n updater: Updater<TInput, TOutput>,\n input: TInput,\n): TOutput {\n return typeof updater === 'function'\n ? (updater as (_: TInput) => TOutput)(input)\n : updater\n}\n\nexport function isValidTimeout(value: unknown): value is number {\n return typeof value === 'number' && value >= 0 && value !== Infinity\n}\n\nexport function timeUntilStale(updatedAt: number, staleTime?: number): number {\n return Math.max(updatedAt + (staleTime || 0) - Date.now(), 0)\n}\n\nexport function matchQuery(\n filters: QueryFilters,\n query: Query<any, any, any, any>,\n): boolean {\n const {\n type = 'all',\n exact,\n fetchStatus,\n predicate,\n queryKey,\n stale,\n } = filters\n\n if (queryKey) {\n if (exact) {\n if (query.queryHash !== hashQueryKeyByOptions(queryKey, query.options)) {\n return false\n }\n } else if (!partialMatchKey(query.queryKey, queryKey)) {\n return false\n }\n }\n\n if (type !== 'all') {\n const isActive = query.isActive()\n if (type === 'active' && !isActive) {\n return false\n }\n if (type === 'inactive' && isActive) {\n return false\n }\n }\n\n if (typeof stale === 'boolean' && query.isStale() !== stale) {\n return false\n }\n\n if (\n typeof fetchStatus !== 'undefined' &&\n fetchStatus !== query.state.fetchStatus\n ) {\n return false\n }\n\n if (predicate && !predicate(query)) {\n return false\n }\n\n return true\n}\n\nexport function matchMutation(\n filters: MutationFilters,\n mutation: Mutation<any, any>,\n): boolean {\n const { exact, status, predicate, mutationKey } = filters\n if (mutationKey) {\n if (!mutation.options.mutationKey) {\n return false\n }\n if (exact) {\n if (hashKey(mutation.options.mutationKey) !== hashKey(mutationKey)) {\n return false\n }\n } else if (!partialMatchKey(mutation.options.mutationKey, mutationKey)) {\n return false\n }\n }\n\n if (status && mutation.state.status !== status) {\n return false\n }\n\n if (predicate && !predicate(mutation)) {\n return false\n }\n\n return true\n}\n\nexport function hashQueryKeyByOptions<TQueryKey extends QueryKey = QueryKey>(\n queryKey: TQueryKey,\n options?: QueryOptions<any, any, any, TQueryKey>,\n): string {\n const hashFn = options?.queryKeyHashFn || hashKey\n return hashFn(queryKey)\n}\n\n/**\n * Default query & mutation keys hash function.\n * Hashes the value into a stable hash.\n */\nexport function hashKey(queryKey: QueryKey | MutationKey): string {\n return JSON.stringify(queryKey, (_, val) =>\n isPlainObject(val)\n ? Object.keys(val)\n .sort()\n .reduce((result, key) => {\n result[key] = val[key]\n return result\n }, {} as any)\n : val,\n )\n}\n\n/**\n * Checks if key `b` partially matches with key `a`.\n */\nexport function partialMatchKey(a: QueryKey, b: QueryKey): boolean\nexport function partialMatchKey(a: any, b: any): boolean {\n if (a === b) {\n return true\n }\n\n if (typeof a !== typeof b) {\n return false\n }\n\n if (a && b && typeof a === 'object' && typeof b === 'object') {\n return !Object.keys(b).some((key) => !partialMatchKey(a[key], b[key]))\n }\n\n return false\n}\n\n/**\n * This function returns `a` if `b` is deeply equal.\n * If not, it will replace any deeply equal children of `b` with those of `a`.\n * This can be used for structural sharing between JSON values for example.\n */\nexport function replaceEqualDeep<T>(a: unknown, b: T): T\nexport function replaceEqualDeep(a: any, b: any): any {\n if (a === b) {\n return a\n }\n\n const array = isPlainArray(a) && isPlainArray(b)\n\n if (array || (isPlainObject(a) && isPlainObject(b))) {\n const aSize = array ? a.length : Object.keys(a).length\n const bItems = array ? b : Object.keys(b)\n const bSize = bItems.length\n const copy: any = array ? [] : {}\n\n let equalItems = 0\n\n for (let i = 0; i < bSize; i++) {\n const key = array ? i : bItems[i]\n copy[key] = replaceEqualDeep(a[key], b[key])\n if (copy[key] === a[key]) {\n equalItems++\n }\n }\n\n return aSize === bSize && equalItems === aSize ? a : copy\n }\n\n return b\n}\n\n/**\n * Shallow compare objects. Only works with objects that always have the same properties.\n */\nexport function shallowEqualObjects<T>(a: T, b: T): boolean {\n if ((a && !b) || (b && !a)) {\n return false\n }\n\n for (const key in a) {\n if (a[key] !== b[key]) {\n return false\n }\n }\n\n return true\n}\n\nexport function isPlainArray(value: unknown) {\n return Array.isArray(value) && value.length === Object.keys(value).length\n}\n\n// Copied from: https://github.com/jonschlinkert/is-plain-object\nexport function isPlainObject(o: any): o is Object {\n if (!hasObjectPrototype(o)) {\n return false\n }\n\n // If has no constructor\n const ctor = o.constructor\n if (typeof ctor === 'undefined') {\n return true\n }\n\n // If has modified prototype\n const prot = ctor.prototype\n if (!hasObjectPrototype(prot)) {\n return false\n }\n\n // If constructor does not have an Object-specific method\n if (!prot.hasOwnProperty('isPrototypeOf')) {\n return false\n }\n\n // Most likely a plain Object\n return true\n}\n\nfunction hasObjectPrototype(o: any): boolean {\n return Object.prototype.toString.call(o) === '[object Object]'\n}\n\nexport function sleep(ms: number): Promise<void> {\n return new Promise((resolve) => {\n setTimeout(resolve, ms)\n })\n}\n\nexport function replaceData<\n TData,\n TOptions extends QueryOptions<any, any, any, any>,\n>(prevData: TData | undefined, data: TData, options: TOptions): TData {\n if (typeof options.structuralSharing === 'function') {\n return options.structuralSharing(prevData, data)\n } else if (options.structuralSharing !== false) {\n // Structurally share data between prev and new data if needed\n return replaceEqualDeep(prevData, data)\n }\n return data\n}\n\nexport function keepPreviousData<T>(\n previousData: T | undefined,\n): T | undefined {\n return previousData\n}\n\nexport function addToEnd<T>(items: Array<T>, item: T, max = 0): Array<T> {\n const newItems = [...items, item]\n return max && newItems.length > max ? newItems.slice(1) : newItems\n}\n\nexport function addToStart<T>(items: Array<T>, item: T, max = 0): Array<T> {\n const newItems = [item, ...items]\n return max && newItems.length > max ? newItems.slice(0, -1) : newItems\n}\n"],"mappings":";;;AAgEO,IAAM,WAAW,OAAO,WAAW,eAAe,UAAU;AAE5D,SAAS,OAAkB;AAChC,SAAO;AACT;AAEO,SAAS,iBACd,SACA,OACS;AACT,SAAO,OAAO,YAAY,aACrB,QAAmC,KAAK,IACzC;AACN;AAEO,SAAS,eAAe,OAAiC;AAC9D,SAAO,OAAO,UAAU,YAAY,SAAS,KAAK,UAAU;AAC9D;AAEO,SAAS,eAAe,WAAmB,WAA4B;AAC5E,SAAO,KAAK,IAAI,aAAa,aAAa,KAAK,KAAK,IAAI,GAAG,CAAC;AAC9D;AAEO,SAAS,WACd,SACA,OACS;AACT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;AAEO,SAAS,iBACd,cACe;AACf,SAAO;AACT;AAEO,SAAS,SAAY,OAAiB,MAAS,MAAM,GAAa;AACvE,QAAM,WAAW,CAAC,GAAG,OAAO,IAAI;AAChC,SAAO,OAAO,SAAS,SAAS,MAAM,SAAS,MAAM,CAAC,IAAI;AAC5D;AAEO,SAAS,WAAc,OAAiB,MAAS,MAAM,GAAa;AACzE,QAAM,WAAW,CAAC,MAAM,GAAG,KAAK;AAChC,SAAO,OAAO,SAAS,SAAS,MAAM,SAAS,MAAM,GAAG,EAAE,IAAI;AAChE;","names":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as Mutation, n as Query, H as QueryOptions, ap as MutationOptions, b as QueryClient, al as MutationKey, p as MutationState, an as MutationMeta, q as QueryKey, l as QueryState, B as QueryMeta } from './queryClient-
|
|
1
|
+
import { o as Mutation, n as Query, H as QueryOptions, ap as MutationOptions, b as QueryClient, al as MutationKey, p as MutationState, an as MutationMeta, q as QueryKey, l as QueryState, B as QueryMeta } from './queryClient-ZM0hKLC_.cjs';
|
|
2
2
|
import './removable.cjs';
|
|
3
3
|
import './subscribable.cjs';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as Mutation, n as Query, H as QueryOptions, ap as MutationOptions, b as QueryClient, al as MutationKey, p as MutationState, an as MutationMeta, q as QueryKey, l as QueryState, B as QueryMeta } from './queryClient-
|
|
1
|
+
import { o as Mutation, n as Query, H as QueryOptions, ap as MutationOptions, b as QueryClient, al as MutationKey, p as MutationState, an as MutationMeta, q as QueryKey, l as QueryState, B as QueryMeta } from './queryClient-mVGWb1w6.js';
|
|
2
2
|
import './removable.js';
|
|
3
3
|
import './subscribable.js';
|
|
4
4
|
|
package/build/modern/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { aB as CancelOptions, C as CancelledError, t as DataTag, D as DefaultError, aA as DefaultOptions, V as DefaultedInfiniteQueryObserverOptions, O as DefaultedQueryObserverOptions, aj as DefinedInfiniteQueryObserverResult, ac as DefinedQueryObserverResult, Y as FetchInfiniteQueryOptions, a3 as FetchNextPageOptions, a4 as FetchPreviousPageOptions, X as FetchQueryOptions, a6 as FetchStatus, z as GetNextPageParamFunction, G as GetPreviousPageParamFunction, A as InfiniteData, ae as InfiniteQueryObserverBaseResult, ag as InfiniteQueryObserverLoadingErrorResult, af as InfiniteQueryObserverLoadingResult, S as InfiniteQueryObserverOptions, ah as InfiniteQueryObserverRefetchErrorResult, ak as InfiniteQueryObserverResult, ai as InfiniteQueryObserverSuccessResult, K as InfiniteQueryPageParamsOptions, I as InitialDataFunction, J as InitialPageParam, a1 as InvalidateOptions, $ as InvalidateQueryFilters, as as MutateFunction, ar as MutateOptions, o as Mutation, M as MutationCache, d as MutationCacheNotifyEvent, f as MutationFilters, ao as MutationFunction, al as MutationKey, an as MutationMeta, e as MutationObserver, at as MutationObserverBaseResult, aw as MutationObserverErrorResult, au as MutationObserverIdleResult, av as MutationObserverLoadingResult, aq as MutationObserverOptions, ay as MutationObserverResult, ax as MutationObserverSuccessResult, ap as MutationOptions, p as MutationState, am as MutationStatus, E as NetworkMode, N as NoInfer, aE as NotifyEvent, aD as NotifyEventType, F as NotifyOnChangeProps, P as PlaceholderDataFunction, x as QueriesPlaceholderDataFunction, n as Query, Q as QueryCache, a as QueryCacheNotifyEvent, b as QueryClient, az as QueryClientConfig, g as QueryFilters, u as QueryFunction, w as QueryFunctionContext, q as QueryKey, y as QueryKeyHashFunction, B as QueryMeta, c as QueryObserver, a7 as QueryObserverBaseResult, a9 as QueryObserverLoadingErrorResult, a8 as QueryObserverLoadingResult, L as QueryObserverOptions, aa as QueryObserverRefetchErrorResult, ad as QueryObserverResult, ab as QueryObserverSuccessResult, H as QueryOptions, v as QueryPersister, l as QueryState, a5 as QueryStatus, _ as RefetchOptions, a0 as RefetchQueryFilters, R as Register, a2 as ResetOptions, Z as ResultOptions, aC as SetDataOptions, T as ThrowOnError, U as Updater, W as WithRequired, s as dataTagSymbol, h as hashKey, j as isCancelledError, i as isServer, k as keepPreviousData, m as matchQuery, r as replaceEqualDeep } from './queryClient-
|
|
1
|
+
export { aB as CancelOptions, C as CancelledError, t as DataTag, D as DefaultError, aA as DefaultOptions, V as DefaultedInfiniteQueryObserverOptions, O as DefaultedQueryObserverOptions, aj as DefinedInfiniteQueryObserverResult, ac as DefinedQueryObserverResult, Y as FetchInfiniteQueryOptions, a3 as FetchNextPageOptions, a4 as FetchPreviousPageOptions, X as FetchQueryOptions, a6 as FetchStatus, z as GetNextPageParamFunction, G as GetPreviousPageParamFunction, A as InfiniteData, ae as InfiniteQueryObserverBaseResult, ag as InfiniteQueryObserverLoadingErrorResult, af as InfiniteQueryObserverLoadingResult, S as InfiniteQueryObserverOptions, ah as InfiniteQueryObserverRefetchErrorResult, ak as InfiniteQueryObserverResult, ai as InfiniteQueryObserverSuccessResult, K as InfiniteQueryPageParamsOptions, I as InitialDataFunction, J as InitialPageParam, a1 as InvalidateOptions, $ as InvalidateQueryFilters, as as MutateFunction, ar as MutateOptions, o as Mutation, M as MutationCache, d as MutationCacheNotifyEvent, f as MutationFilters, ao as MutationFunction, al as MutationKey, an as MutationMeta, e as MutationObserver, at as MutationObserverBaseResult, aw as MutationObserverErrorResult, au as MutationObserverIdleResult, av as MutationObserverLoadingResult, aq as MutationObserverOptions, ay as MutationObserverResult, ax as MutationObserverSuccessResult, ap as MutationOptions, p as MutationState, am as MutationStatus, E as NetworkMode, N as NoInfer, aE as NotifyEvent, aD as NotifyEventType, F as NotifyOnChangeProps, P as PlaceholderDataFunction, x as QueriesPlaceholderDataFunction, n as Query, Q as QueryCache, a as QueryCacheNotifyEvent, b as QueryClient, az as QueryClientConfig, g as QueryFilters, u as QueryFunction, w as QueryFunctionContext, q as QueryKey, y as QueryKeyHashFunction, B as QueryMeta, c as QueryObserver, a7 as QueryObserverBaseResult, a9 as QueryObserverLoadingErrorResult, a8 as QueryObserverLoadingResult, L as QueryObserverOptions, aa as QueryObserverRefetchErrorResult, ad as QueryObserverResult, ab as QueryObserverSuccessResult, H as QueryOptions, v as QueryPersister, l as QueryState, a5 as QueryStatus, _ as RefetchOptions, a0 as RefetchQueryFilters, R as Register, a2 as ResetOptions, Z as ResultOptions, aC as SetDataOptions, T as ThrowOnError, U as Updater, W as WithRequired, s as dataTagSymbol, h as hashKey, j as isCancelledError, i as isServer, k as keepPreviousData, m as matchQuery, r as replaceEqualDeep } from './queryClient-ZM0hKLC_.cjs';
|
|
2
2
|
export { QueriesObserver, QueriesObserverOptions } from './queriesObserver.cjs';
|
|
3
3
|
export { InfiniteQueryObserver } from './infiniteQueryObserver.cjs';
|
|
4
4
|
export { notifyManager } from './notifyManager.cjs';
|
package/build/modern/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { aB as CancelOptions, C as CancelledError, t as DataTag, D as DefaultError, aA as DefaultOptions, V as DefaultedInfiniteQueryObserverOptions, O as DefaultedQueryObserverOptions, aj as DefinedInfiniteQueryObserverResult, ac as DefinedQueryObserverResult, Y as FetchInfiniteQueryOptions, a3 as FetchNextPageOptions, a4 as FetchPreviousPageOptions, X as FetchQueryOptions, a6 as FetchStatus, z as GetNextPageParamFunction, G as GetPreviousPageParamFunction, A as InfiniteData, ae as InfiniteQueryObserverBaseResult, ag as InfiniteQueryObserverLoadingErrorResult, af as InfiniteQueryObserverLoadingResult, S as InfiniteQueryObserverOptions, ah as InfiniteQueryObserverRefetchErrorResult, ak as InfiniteQueryObserverResult, ai as InfiniteQueryObserverSuccessResult, K as InfiniteQueryPageParamsOptions, I as InitialDataFunction, J as InitialPageParam, a1 as InvalidateOptions, $ as InvalidateQueryFilters, as as MutateFunction, ar as MutateOptions, o as Mutation, M as MutationCache, d as MutationCacheNotifyEvent, f as MutationFilters, ao as MutationFunction, al as MutationKey, an as MutationMeta, e as MutationObserver, at as MutationObserverBaseResult, aw as MutationObserverErrorResult, au as MutationObserverIdleResult, av as MutationObserverLoadingResult, aq as MutationObserverOptions, ay as MutationObserverResult, ax as MutationObserverSuccessResult, ap as MutationOptions, p as MutationState, am as MutationStatus, E as NetworkMode, N as NoInfer, aE as NotifyEvent, aD as NotifyEventType, F as NotifyOnChangeProps, P as PlaceholderDataFunction, x as QueriesPlaceholderDataFunction, n as Query, Q as QueryCache, a as QueryCacheNotifyEvent, b as QueryClient, az as QueryClientConfig, g as QueryFilters, u as QueryFunction, w as QueryFunctionContext, q as QueryKey, y as QueryKeyHashFunction, B as QueryMeta, c as QueryObserver, a7 as QueryObserverBaseResult, a9 as QueryObserverLoadingErrorResult, a8 as QueryObserverLoadingResult, L as QueryObserverOptions, aa as QueryObserverRefetchErrorResult, ad as QueryObserverResult, ab as QueryObserverSuccessResult, H as QueryOptions, v as QueryPersister, l as QueryState, a5 as QueryStatus, _ as RefetchOptions, a0 as RefetchQueryFilters, R as Register, a2 as ResetOptions, Z as ResultOptions, aC as SetDataOptions, T as ThrowOnError, U as Updater, W as WithRequired, s as dataTagSymbol, h as hashKey, j as isCancelledError, i as isServer, k as keepPreviousData, m as matchQuery, r as replaceEqualDeep } from './queryClient-
|
|
1
|
+
export { aB as CancelOptions, C as CancelledError, t as DataTag, D as DefaultError, aA as DefaultOptions, V as DefaultedInfiniteQueryObserverOptions, O as DefaultedQueryObserverOptions, aj as DefinedInfiniteQueryObserverResult, ac as DefinedQueryObserverResult, Y as FetchInfiniteQueryOptions, a3 as FetchNextPageOptions, a4 as FetchPreviousPageOptions, X as FetchQueryOptions, a6 as FetchStatus, z as GetNextPageParamFunction, G as GetPreviousPageParamFunction, A as InfiniteData, ae as InfiniteQueryObserverBaseResult, ag as InfiniteQueryObserverLoadingErrorResult, af as InfiniteQueryObserverLoadingResult, S as InfiniteQueryObserverOptions, ah as InfiniteQueryObserverRefetchErrorResult, ak as InfiniteQueryObserverResult, ai as InfiniteQueryObserverSuccessResult, K as InfiniteQueryPageParamsOptions, I as InitialDataFunction, J as InitialPageParam, a1 as InvalidateOptions, $ as InvalidateQueryFilters, as as MutateFunction, ar as MutateOptions, o as Mutation, M as MutationCache, d as MutationCacheNotifyEvent, f as MutationFilters, ao as MutationFunction, al as MutationKey, an as MutationMeta, e as MutationObserver, at as MutationObserverBaseResult, aw as MutationObserverErrorResult, au as MutationObserverIdleResult, av as MutationObserverLoadingResult, aq as MutationObserverOptions, ay as MutationObserverResult, ax as MutationObserverSuccessResult, ap as MutationOptions, p as MutationState, am as MutationStatus, E as NetworkMode, N as NoInfer, aE as NotifyEvent, aD as NotifyEventType, F as NotifyOnChangeProps, P as PlaceholderDataFunction, x as QueriesPlaceholderDataFunction, n as Query, Q as QueryCache, a as QueryCacheNotifyEvent, b as QueryClient, az as QueryClientConfig, g as QueryFilters, u as QueryFunction, w as QueryFunctionContext, q as QueryKey, y as QueryKeyHashFunction, B as QueryMeta, c as QueryObserver, a7 as QueryObserverBaseResult, a9 as QueryObserverLoadingErrorResult, a8 as QueryObserverLoadingResult, L as QueryObserverOptions, aa as QueryObserverRefetchErrorResult, ad as QueryObserverResult, ab as QueryObserverSuccessResult, H as QueryOptions, v as QueryPersister, l as QueryState, a5 as QueryStatus, _ as RefetchOptions, a0 as RefetchQueryFilters, R as Register, a2 as ResetOptions, Z as ResultOptions, aC as SetDataOptions, T as ThrowOnError, U as Updater, W as WithRequired, s as dataTagSymbol, h as hashKey, j as isCancelledError, i as isServer, k as keepPreviousData, m as matchQuery, r as replaceEqualDeep } from './queryClient-mVGWb1w6.js';
|
|
2
2
|
export { QueriesObserver, QueriesObserverOptions } from './queriesObserver.js';
|
|
3
3
|
export { InfiniteQueryObserver } from './infiniteQueryObserver.js';
|
|
4
4
|
export { notifyManager } from './notifyManager.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aF as QueryBehavior, A as InfiniteData, K as InfiniteQueryPageParamsOptions } from './queryClient-
|
|
1
|
+
import { aF as QueryBehavior, A as InfiniteData, K as InfiniteQueryPageParamsOptions } from './queryClient-ZM0hKLC_.cjs';
|
|
2
2
|
import './removable.cjs';
|
|
3
3
|
import './subscribable.cjs';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aF as QueryBehavior, A as InfiniteData, K as InfiniteQueryPageParamsOptions } from './queryClient-
|
|
1
|
+
import { aF as QueryBehavior, A as InfiniteData, K as InfiniteQueryPageParamsOptions } from './queryClient-mVGWb1w6.js';
|
|
2
2
|
import './removable.js';
|
|
3
3
|
import './subscribable.js';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as DefaultError, A as InfiniteData, q as QueryKey, c as QueryObserver, ak as InfiniteQueryObserverResult, aG as ObserverFetchOptions, b as QueryClient, S as InfiniteQueryObserverOptions, aH as NotifyOptions, V as DefaultedInfiniteQueryObserverOptions, a3 as FetchNextPageOptions, a4 as FetchPreviousPageOptions, n as Query } from './queryClient-
|
|
1
|
+
import { D as DefaultError, A as InfiniteData, q as QueryKey, c as QueryObserver, ak as InfiniteQueryObserverResult, aG as ObserverFetchOptions, b as QueryClient, S as InfiniteQueryObserverOptions, aH as NotifyOptions, V as DefaultedInfiniteQueryObserverOptions, a3 as FetchNextPageOptions, a4 as FetchPreviousPageOptions, n as Query } from './queryClient-ZM0hKLC_.cjs';
|
|
2
2
|
import './removable.cjs';
|
|
3
3
|
import './subscribable.cjs';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as DefaultError, A as InfiniteData, q as QueryKey, c as QueryObserver, ak as InfiniteQueryObserverResult, aG as ObserverFetchOptions, b as QueryClient, S as InfiniteQueryObserverOptions, aH as NotifyOptions, V as DefaultedInfiniteQueryObserverOptions, a3 as FetchNextPageOptions, a4 as FetchPreviousPageOptions, n as Query } from './queryClient-
|
|
1
|
+
import { D as DefaultError, A as InfiniteData, q as QueryKey, c as QueryObserver, ak as InfiniteQueryObserverResult, aG as ObserverFetchOptions, b as QueryClient, S as InfiniteQueryObserverOptions, aH as NotifyOptions, V as DefaultedInfiniteQueryObserverOptions, a3 as FetchNextPageOptions, a4 as FetchPreviousPageOptions, n as Query } from './queryClient-mVGWb1w6.js';
|
|
2
2
|
import './removable.js';
|
|
3
3
|
import './subscribable.js';
|
|
4
4
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import './removable.cjs';
|
|
2
|
-
export {
|
|
2
|
+
export { aX as Action, o as Mutation, p as MutationState, aY as getDefaultState } from './queryClient-ZM0hKLC_.cjs';
|
|
3
3
|
import './subscribable.cjs';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import './removable.js';
|
|
2
|
-
export {
|
|
2
|
+
export { aX as Action, o as Mutation, p as MutationState, aY as getDefaultState } from './queryClient-mVGWb1w6.js';
|
|
3
3
|
import './subscribable.js';
|
|
@@ -24,7 +24,6 @@ __export(notifyManager_exports, {
|
|
|
24
24
|
notifyManager: () => notifyManager
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(notifyManager_exports);
|
|
27
|
-
var import_utils = require("./utils.cjs");
|
|
28
27
|
function createNotifyManager() {
|
|
29
28
|
let queue = [];
|
|
30
29
|
let transactions = 0;
|
|
@@ -34,6 +33,10 @@ function createNotifyManager() {
|
|
|
34
33
|
let batchNotifyFn = (callback) => {
|
|
35
34
|
callback();
|
|
36
35
|
};
|
|
36
|
+
let scheduleFn = (cb) => setTimeout(cb, 0);
|
|
37
|
+
const setScheduler = (fn) => {
|
|
38
|
+
scheduleFn = fn;
|
|
39
|
+
};
|
|
37
40
|
const batch = (callback) => {
|
|
38
41
|
let result;
|
|
39
42
|
transactions++;
|
|
@@ -51,7 +54,7 @@ function createNotifyManager() {
|
|
|
51
54
|
if (transactions) {
|
|
52
55
|
queue.push(callback);
|
|
53
56
|
} else {
|
|
54
|
-
(
|
|
57
|
+
scheduleFn(() => {
|
|
55
58
|
notifyFn(callback);
|
|
56
59
|
});
|
|
57
60
|
}
|
|
@@ -67,7 +70,7 @@ function createNotifyManager() {
|
|
|
67
70
|
const originalQueue = queue;
|
|
68
71
|
queue = [];
|
|
69
72
|
if (originalQueue.length) {
|
|
70
|
-
(
|
|
73
|
+
scheduleFn(() => {
|
|
71
74
|
batchNotifyFn(() => {
|
|
72
75
|
originalQueue.forEach((callback) => {
|
|
73
76
|
notifyFn(callback);
|
|
@@ -87,7 +90,8 @@ function createNotifyManager() {
|
|
|
87
90
|
batchCalls,
|
|
88
91
|
schedule,
|
|
89
92
|
setNotifyFunction,
|
|
90
|
-
setBatchNotifyFunction
|
|
93
|
+
setBatchNotifyFunction,
|
|
94
|
+
setScheduler
|
|
91
95
|
};
|
|
92
96
|
}
|
|
93
97
|
var notifyManager = createNotifyManager();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/notifyManager.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../../src/notifyManager.ts"],"sourcesContent":["// TYPES\n\ntype NotifyCallback = () => void\n\ntype NotifyFunction = (callback: () => void) => void\n\ntype BatchNotifyFunction = (callback: () => void) => void\n\ntype BatchCallsCallback<T extends Array<unknown>> = (...args: T) => void\n\ntype ScheduleFunction = (callback: () => void) => void\n\nexport function createNotifyManager() {\n let queue: Array<NotifyCallback> = []\n let transactions = 0\n let notifyFn: NotifyFunction = (callback) => {\n callback()\n }\n let batchNotifyFn: BatchNotifyFunction = (callback: () => void) => {\n callback()\n }\n let scheduleFn: ScheduleFunction = (cb) => setTimeout(cb, 0)\n\n const setScheduler = (fn: ScheduleFunction) => {\n scheduleFn = fn\n }\n\n const batch = <T>(callback: () => T): T => {\n let result\n transactions++\n try {\n result = callback()\n } finally {\n transactions--\n if (!transactions) {\n flush()\n }\n }\n return result\n }\n\n const schedule = (callback: NotifyCallback): void => {\n if (transactions) {\n queue.push(callback)\n } else {\n scheduleFn(() => {\n notifyFn(callback)\n })\n }\n }\n\n /**\n * All calls to the wrapped function will be batched.\n */\n const batchCalls = <T extends Array<unknown>>(\n callback: BatchCallsCallback<T>,\n ): BatchCallsCallback<T> => {\n return (...args) => {\n schedule(() => {\n callback(...args)\n })\n }\n }\n\n const flush = (): void => {\n const originalQueue = queue\n queue = []\n if (originalQueue.length) {\n scheduleFn(() => {\n batchNotifyFn(() => {\n originalQueue.forEach((callback) => {\n notifyFn(callback)\n })\n })\n })\n }\n }\n\n /**\n * Use this method to set a custom notify function.\n * This can be used to for example wrap notifications with `React.act` while running tests.\n */\n const setNotifyFunction = (fn: NotifyFunction) => {\n notifyFn = fn\n }\n\n /**\n * Use this method to set a custom function to batch notifications together into a single tick.\n * By default React Query will use the batch function provided by ReactDOM or React Native.\n */\n const setBatchNotifyFunction = (fn: BatchNotifyFunction) => {\n batchNotifyFn = fn\n }\n\n return {\n batch,\n batchCalls,\n schedule,\n setNotifyFunction,\n setBatchNotifyFunction,\n setScheduler,\n } as const\n}\n\n// SINGLETON\nexport const notifyManager = createNotifyManager()\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYO,SAAS,sBAAsB;AACpC,MAAI,QAA+B,CAAC;AACpC,MAAI,eAAe;AACnB,MAAI,WAA2B,CAAC,aAAa;AAC3C,aAAS;AAAA,EACX;AACA,MAAI,gBAAqC,CAAC,aAAyB;AACjE,aAAS;AAAA,EACX;AACA,MAAI,aAA+B,CAAC,OAAO,WAAW,IAAI,CAAC;AAE3D,QAAM,eAAe,CAAC,OAAyB;AAC7C,iBAAa;AAAA,EACf;AAEA,QAAM,QAAQ,CAAI,aAAyB;AACzC,QAAI;AACJ;AACA,QAAI;AACF,eAAS,SAAS;AAAA,IACpB,UAAE;AACA;AACA,UAAI,CAAC,cAAc;AACjB,cAAM;AAAA,MACR;AAAA,IACF;AACA,WAAO;AAAA,EACT;AAEA,QAAM,WAAW,CAAC,aAAmC;AACnD,QAAI,cAAc;AAChB,YAAM,KAAK,QAAQ;AAAA,IACrB,OAAO;AACL,iBAAW,MAAM;AACf,iBAAS,QAAQ;AAAA,MACnB,CAAC;AAAA,IACH;AAAA,EACF;AAKA,QAAM,aAAa,CACjB,aAC0B;AAC1B,WAAO,IAAI,SAAS;AAClB,eAAS,MAAM;AACb,iBAAS,GAAG,IAAI;AAAA,MAClB,CAAC;AAAA,IACH;AAAA,EACF;AAEA,QAAM,QAAQ,MAAY;AACxB,UAAM,gBAAgB;AACtB,YAAQ,CAAC;AACT,QAAI,cAAc,QAAQ;AACxB,iBAAW,MAAM;AACf,sBAAc,MAAM;AAClB,wBAAc,QAAQ,CAAC,aAAa;AAClC,qBAAS,QAAQ;AAAA,UACnB,CAAC;AAAA,QACH,CAAC;AAAA,MACH,CAAC;AAAA,IACH;AAAA,EACF;AAMA,QAAM,oBAAoB,CAAC,OAAuB;AAChD,eAAW;AAAA,EACb;AAMA,QAAM,yBAAyB,CAAC,OAA4B;AAC1D,oBAAgB;AAAA,EAClB;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAGO,IAAM,gBAAgB,oBAAoB;","names":[]}
|
|
@@ -2,12 +2,14 @@ type NotifyCallback = () => void;
|
|
|
2
2
|
type NotifyFunction = (callback: () => void) => void;
|
|
3
3
|
type BatchNotifyFunction = (callback: () => void) => void;
|
|
4
4
|
type BatchCallsCallback<T extends Array<unknown>> = (...args: T) => void;
|
|
5
|
+
type ScheduleFunction = (callback: () => void) => void;
|
|
5
6
|
declare function createNotifyManager(): {
|
|
6
7
|
readonly batch: <T>(callback: () => T) => T;
|
|
7
8
|
readonly batchCalls: <T_1 extends unknown[]>(callback: BatchCallsCallback<T_1>) => BatchCallsCallback<T_1>;
|
|
8
9
|
readonly schedule: (callback: NotifyCallback) => void;
|
|
9
10
|
readonly setNotifyFunction: (fn: NotifyFunction) => void;
|
|
10
11
|
readonly setBatchNotifyFunction: (fn: BatchNotifyFunction) => void;
|
|
12
|
+
readonly setScheduler: (fn: ScheduleFunction) => void;
|
|
11
13
|
};
|
|
12
14
|
declare const notifyManager: {
|
|
13
15
|
readonly batch: <T>(callback: () => T) => T;
|
|
@@ -15,6 +17,7 @@ declare const notifyManager: {
|
|
|
15
17
|
readonly schedule: (callback: NotifyCallback) => void;
|
|
16
18
|
readonly setNotifyFunction: (fn: NotifyFunction) => void;
|
|
17
19
|
readonly setBatchNotifyFunction: (fn: BatchNotifyFunction) => void;
|
|
20
|
+
readonly setScheduler: (fn: ScheduleFunction) => void;
|
|
18
21
|
};
|
|
19
22
|
|
|
20
23
|
export { createNotifyManager, notifyManager };
|
|
@@ -2,12 +2,14 @@ type NotifyCallback = () => void;
|
|
|
2
2
|
type NotifyFunction = (callback: () => void) => void;
|
|
3
3
|
type BatchNotifyFunction = (callback: () => void) => void;
|
|
4
4
|
type BatchCallsCallback<T extends Array<unknown>> = (...args: T) => void;
|
|
5
|
+
type ScheduleFunction = (callback: () => void) => void;
|
|
5
6
|
declare function createNotifyManager(): {
|
|
6
7
|
readonly batch: <T>(callback: () => T) => T;
|
|
7
8
|
readonly batchCalls: <T_1 extends unknown[]>(callback: BatchCallsCallback<T_1>) => BatchCallsCallback<T_1>;
|
|
8
9
|
readonly schedule: (callback: NotifyCallback) => void;
|
|
9
10
|
readonly setNotifyFunction: (fn: NotifyFunction) => void;
|
|
10
11
|
readonly setBatchNotifyFunction: (fn: BatchNotifyFunction) => void;
|
|
12
|
+
readonly setScheduler: (fn: ScheduleFunction) => void;
|
|
11
13
|
};
|
|
12
14
|
declare const notifyManager: {
|
|
13
15
|
readonly batch: <T>(callback: () => T) => T;
|
|
@@ -15,6 +17,7 @@ declare const notifyManager: {
|
|
|
15
17
|
readonly schedule: (callback: NotifyCallback) => void;
|
|
16
18
|
readonly setNotifyFunction: (fn: NotifyFunction) => void;
|
|
17
19
|
readonly setBatchNotifyFunction: (fn: BatchNotifyFunction) => void;
|
|
20
|
+
readonly setScheduler: (fn: ScheduleFunction) => void;
|
|
18
21
|
};
|
|
19
22
|
|
|
20
23
|
export { createNotifyManager, notifyManager };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
// src/notifyManager.ts
|
|
2
|
-
import { scheduleMicrotask } from "./utils.js";
|
|
3
2
|
function createNotifyManager() {
|
|
4
3
|
let queue = [];
|
|
5
4
|
let transactions = 0;
|
|
@@ -9,6 +8,10 @@ function createNotifyManager() {
|
|
|
9
8
|
let batchNotifyFn = (callback) => {
|
|
10
9
|
callback();
|
|
11
10
|
};
|
|
11
|
+
let scheduleFn = (cb) => setTimeout(cb, 0);
|
|
12
|
+
const setScheduler = (fn) => {
|
|
13
|
+
scheduleFn = fn;
|
|
14
|
+
};
|
|
12
15
|
const batch = (callback) => {
|
|
13
16
|
let result;
|
|
14
17
|
transactions++;
|
|
@@ -26,7 +29,7 @@ function createNotifyManager() {
|
|
|
26
29
|
if (transactions) {
|
|
27
30
|
queue.push(callback);
|
|
28
31
|
} else {
|
|
29
|
-
|
|
32
|
+
scheduleFn(() => {
|
|
30
33
|
notifyFn(callback);
|
|
31
34
|
});
|
|
32
35
|
}
|
|
@@ -42,7 +45,7 @@ function createNotifyManager() {
|
|
|
42
45
|
const originalQueue = queue;
|
|
43
46
|
queue = [];
|
|
44
47
|
if (originalQueue.length) {
|
|
45
|
-
|
|
48
|
+
scheduleFn(() => {
|
|
46
49
|
batchNotifyFn(() => {
|
|
47
50
|
originalQueue.forEach((callback) => {
|
|
48
51
|
notifyFn(callback);
|
|
@@ -62,7 +65,8 @@ function createNotifyManager() {
|
|
|
62
65
|
batchCalls,
|
|
63
66
|
schedule,
|
|
64
67
|
setNotifyFunction,
|
|
65
|
-
setBatchNotifyFunction
|
|
68
|
+
setBatchNotifyFunction,
|
|
69
|
+
setScheduler
|
|
66
70
|
};
|
|
67
71
|
}
|
|
68
72
|
var notifyManager = createNotifyManager();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/notifyManager.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../../src/notifyManager.ts"],"sourcesContent":["// TYPES\n\ntype NotifyCallback = () => void\n\ntype NotifyFunction = (callback: () => void) => void\n\ntype BatchNotifyFunction = (callback: () => void) => void\n\ntype BatchCallsCallback<T extends Array<unknown>> = (...args: T) => void\n\ntype ScheduleFunction = (callback: () => void) => void\n\nexport function createNotifyManager() {\n let queue: Array<NotifyCallback> = []\n let transactions = 0\n let notifyFn: NotifyFunction = (callback) => {\n callback()\n }\n let batchNotifyFn: BatchNotifyFunction = (callback: () => void) => {\n callback()\n }\n let scheduleFn: ScheduleFunction = (cb) => setTimeout(cb, 0)\n\n const setScheduler = (fn: ScheduleFunction) => {\n scheduleFn = fn\n }\n\n const batch = <T>(callback: () => T): T => {\n let result\n transactions++\n try {\n result = callback()\n } finally {\n transactions--\n if (!transactions) {\n flush()\n }\n }\n return result\n }\n\n const schedule = (callback: NotifyCallback): void => {\n if (transactions) {\n queue.push(callback)\n } else {\n scheduleFn(() => {\n notifyFn(callback)\n })\n }\n }\n\n /**\n * All calls to the wrapped function will be batched.\n */\n const batchCalls = <T extends Array<unknown>>(\n callback: BatchCallsCallback<T>,\n ): BatchCallsCallback<T> => {\n return (...args) => {\n schedule(() => {\n callback(...args)\n })\n }\n }\n\n const flush = (): void => {\n const originalQueue = queue\n queue = []\n if (originalQueue.length) {\n scheduleFn(() => {\n batchNotifyFn(() => {\n originalQueue.forEach((callback) => {\n notifyFn(callback)\n })\n })\n })\n }\n }\n\n /**\n * Use this method to set a custom notify function.\n * This can be used to for example wrap notifications with `React.act` while running tests.\n */\n const setNotifyFunction = (fn: NotifyFunction) => {\n notifyFn = fn\n }\n\n /**\n * Use this method to set a custom function to batch notifications together into a single tick.\n * By default React Query will use the batch function provided by ReactDOM or React Native.\n */\n const setBatchNotifyFunction = (fn: BatchNotifyFunction) => {\n batchNotifyFn = fn\n }\n\n return {\n batch,\n batchCalls,\n schedule,\n setNotifyFunction,\n setBatchNotifyFunction,\n setScheduler,\n } as const\n}\n\n// SINGLETON\nexport const notifyManager = createNotifyManager()\n"],"mappings":";AAYO,SAAS,sBAAsB;AACpC,MAAI,QAA+B,CAAC;AACpC,MA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4 @@
|
|
|
1
|
-
import { ad as QueryObserverResult, b as QueryClient, L as QueryObserverOptions, aH as NotifyOptions, n as Query, q as QueryKey, c as QueryObserver } from './queryClient-
|
|
1
|
+
import { ad as QueryObserverResult, b as QueryClient, L as QueryObserverOptions, aH as NotifyOptions, n as Query, q as QueryKey, c as QueryObserver } from './queryClient-ZM0hKLC_.cjs';
|
|
2
2
|
import { Subscribable } from './subscribable.cjs';
|
|
3
3
|
import './removable.cjs';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ad as QueryObserverResult, b as QueryClient, L as QueryObserverOptions, aH as NotifyOptions, n as Query, q as QueryKey, c as QueryObserver } from './queryClient-
|
|
1
|
+
import { ad as QueryObserverResult, b as QueryClient, L as QueryObserverOptions, aH as NotifyOptions, n as Query, q as QueryKey, c as QueryObserver } from './queryClient-mVGWb1w6.js';
|
|
2
2
|
import { Subscribable } from './subscribable.js';
|
|
3
3
|
import './removable.js';
|
|
4
4
|
|
package/build/modern/query.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import './removable.cjs';
|
|
2
|
-
export {
|
|
2
|
+
export { b6 as Action, b2 as FetchContext, b3 as FetchDirection, b4 as FetchMeta, b5 as FetchOptions, n as Query, aF as QueryBehavior, l as QueryState, b7 as SetStateOptions } from './queryClient-ZM0hKLC_.cjs';
|
|
3
3
|
import './subscribable.cjs';
|
package/build/modern/query.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import './removable.js';
|
|
2
|
-
export {
|
|
2
|
+
export { b6 as Action, b2 as FetchContext, b3 as FetchDirection, b4 as FetchMeta, b5 as FetchOptions, n as Query, aF as QueryBehavior, l as QueryState, b7 as SetStateOptions } from './queryClient-mVGWb1w6.js';
|
|
3
3
|
import './subscribable.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { Q as QueryCache, a as QueryCacheNotifyEvent,
|
|
1
|
+
export { Q as QueryCache, a as QueryCacheNotifyEvent, b8 as QueryStore } from './queryClient-ZM0hKLC_.cjs';
|
|
2
2
|
import './subscribable.cjs';
|
|
3
3
|
import './removable.cjs';
|
|
@@ -91,11 +91,6 @@ declare function shallowEqualObjects<T>(a: T, b: T): boolean;
|
|
|
91
91
|
declare function isPlainArray(value: unknown): boolean;
|
|
92
92
|
declare function isPlainObject(o: any): o is Object;
|
|
93
93
|
declare function sleep(ms: number): Promise<void>;
|
|
94
|
-
/**
|
|
95
|
-
* Schedules a microtask.
|
|
96
|
-
* This can be useful to schedule state updates after rendering.
|
|
97
|
-
*/
|
|
98
|
-
declare function scheduleMicrotask(callback: () => void): void;
|
|
99
94
|
declare function replaceData<TData, TOptions extends QueryOptions<any, any, any, any>>(prevData: TData | undefined, data: TData, options: TOptions): TData;
|
|
100
95
|
declare function keepPreviousData<T>(previousData: T | undefined): T | undefined;
|
|
101
96
|
declare function addToEnd<T>(items: Array<T>, item: T, max?: number): Array<T>;
|
|
@@ -929,4 +924,4 @@ declare class QueryClient {
|
|
|
929
924
|
clear(): void;
|
|
930
925
|
}
|
|
931
926
|
|
|
932
|
-
export { type InvalidateQueryFilters as $, type InfiniteData as A, type QueryMeta as B, CancelledError as C, type DefaultError as D, type NetworkMode as E, type NotifyOnChangeProps as F, type GetPreviousPageParamFunction as G, type QueryOptions as H, type InitialDataFunction as I, type InitialPageParam as J, type InfiniteQueryPageParamsOptions as K, type QueryObserverOptions as L, MutationCache as M, type NoInfer as N, type DefaultedQueryObserverOptions as O, type PlaceholderDataFunction as P, QueryCache as Q, type Register as R, type InfiniteQueryObserverOptions as S, type ThrowOnError as T, type Updater as U, type DefaultedInfiniteQueryObserverOptions as V, type WithRequired as W, type FetchQueryOptions as X, type FetchInfiniteQueryOptions as Y, type ResultOptions as Z, type RefetchOptions as _, type QueryCacheNotifyEvent as a, type
|
|
927
|
+
export { type InvalidateQueryFilters as $, type InfiniteData as A, type QueryMeta as B, CancelledError as C, type DefaultError as D, type NetworkMode as E, type NotifyOnChangeProps as F, type GetPreviousPageParamFunction as G, type QueryOptions as H, type InitialDataFunction as I, type InitialPageParam as J, type InfiniteQueryPageParamsOptions as K, type QueryObserverOptions as L, MutationCache as M, type NoInfer as N, type DefaultedQueryObserverOptions as O, type PlaceholderDataFunction as P, QueryCache as Q, type Register as R, type InfiniteQueryObserverOptions as S, type ThrowOnError as T, type Updater as U, type DefaultedInfiniteQueryObserverOptions as V, type WithRequired as W, type FetchQueryOptions as X, type FetchInfiniteQueryOptions as Y, type ResultOptions as Z, type RefetchOptions as _, type QueryCacheNotifyEvent as a, type RetryDelayValue as a$, type RefetchQueryFilters as a0, type InvalidateOptions as a1, type ResetOptions as a2, type FetchNextPageOptions as a3, type FetchPreviousPageOptions as a4, type QueryStatus as a5, type FetchStatus as a6, type QueryObserverBaseResult as a7, type QueryObserverLoadingResult as a8, type QueryObserverLoadingErrorResult as a9, type DefaultOptions as aA, type CancelOptions as aB, type SetDataOptions as aC, type NotifyEventType as aD, type NotifyEvent as aE, type QueryBehavior as aF, type ObserverFetchOptions as aG, type NotifyOptions as aH, type QueryTypeFilter as aI, noop as aJ, functionalUpdate as aK, isValidTimeout as aL, timeUntilStale as aM, matchMutation as aN, hashQueryKeyByOptions as aO, partialMatchKey as aP, shallowEqualObjects as aQ, isPlainArray as aR, isPlainObject as aS, sleep as aT, replaceData as aU, addToEnd as aV, addToStart as aW, type Action$1 as aX, getDefaultState as aY, type Retryer as aZ, type RetryValue as a_, type QueryObserverRefetchErrorResult as aa, type QueryObserverSuccessResult as ab, type DefinedQueryObserverResult as ac, type QueryObserverResult as ad, type InfiniteQueryObserverBaseResult as ae, type InfiniteQueryObserverLoadingResult as af, type InfiniteQueryObserverLoadingErrorResult as ag, type InfiniteQueryObserverRefetchErrorResult as ah, type InfiniteQueryObserverSuccessResult as ai, type DefinedInfiniteQueryObserverResult as aj, type InfiniteQueryObserverResult as ak, type MutationKey as al, type MutationStatus as am, type MutationMeta as an, type MutationFunction as ao, type MutationOptions as ap, type MutationObserverOptions as aq, type MutateOptions as ar, type MutateFunction as as, type MutationObserverBaseResult as at, type MutationObserverIdleResult as au, type MutationObserverLoadingResult as av, type MutationObserverErrorResult as aw, type MutationObserverSuccessResult as ax, type MutationObserverResult as ay, type QueryClientConfig as az, QueryClient as b, canFetch as b0, createRetryer as b1, type FetchContext as b2, type FetchDirection as b3, type FetchMeta as b4, type FetchOptions as b5, type Action as b6, type SetStateOptions as b7, type QueryStore as b8, QueryObserver as c, type MutationCacheNotifyEvent as d, MutationObserver as e, type MutationFilters as f, type QueryFilters as g, hashKey as h, isServer as i, isCancelledError as j, keepPreviousData as k, type QueryState as l, matchQuery as m, Query as n, Mutation as o, type MutationState as p, type QueryKey as q, replaceEqualDeep as r, dataTagSymbol as s, type DataTag as t, type QueryFunction as u, type QueryPersister as v, type QueryFunctionContext as w, type QueriesPlaceholderDataFunction as x, type QueryKeyHashFunction as y, type GetNextPageParamFunction as z };
|
|
@@ -91,11 +91,6 @@ declare function shallowEqualObjects<T>(a: T, b: T): boolean;
|
|
|
91
91
|
declare function isPlainArray(value: unknown): boolean;
|
|
92
92
|
declare function isPlainObject(o: any): o is Object;
|
|
93
93
|
declare function sleep(ms: number): Promise<void>;
|
|
94
|
-
/**
|
|
95
|
-
* Schedules a microtask.
|
|
96
|
-
* This can be useful to schedule state updates after rendering.
|
|
97
|
-
*/
|
|
98
|
-
declare function scheduleMicrotask(callback: () => void): void;
|
|
99
94
|
declare function replaceData<TData, TOptions extends QueryOptions<any, any, any, any>>(prevData: TData | undefined, data: TData, options: TOptions): TData;
|
|
100
95
|
declare function keepPreviousData<T>(previousData: T | undefined): T | undefined;
|
|
101
96
|
declare function addToEnd<T>(items: Array<T>, item: T, max?: number): Array<T>;
|
|
@@ -929,4 +924,4 @@ declare class QueryClient {
|
|
|
929
924
|
clear(): void;
|
|
930
925
|
}
|
|
931
926
|
|
|
932
|
-
export { type InvalidateQueryFilters as $, type InfiniteData as A, type QueryMeta as B, CancelledError as C, type DefaultError as D, type NetworkMode as E, type NotifyOnChangeProps as F, type GetPreviousPageParamFunction as G, type QueryOptions as H, type InitialDataFunction as I, type InitialPageParam as J, type InfiniteQueryPageParamsOptions as K, type QueryObserverOptions as L, MutationCache as M, type NoInfer as N, type DefaultedQueryObserverOptions as O, type PlaceholderDataFunction as P, QueryCache as Q, type Register as R, type InfiniteQueryObserverOptions as S, type ThrowOnError as T, type Updater as U, type DefaultedInfiniteQueryObserverOptions as V, type WithRequired as W, type FetchQueryOptions as X, type FetchInfiniteQueryOptions as Y, type ResultOptions as Z, type RefetchOptions as _, type QueryCacheNotifyEvent as a, type
|
|
927
|
+
export { type InvalidateQueryFilters as $, type InfiniteData as A, type QueryMeta as B, CancelledError as C, type DefaultError as D, type NetworkMode as E, type NotifyOnChangeProps as F, type GetPreviousPageParamFunction as G, type QueryOptions as H, type InitialDataFunction as I, type InitialPageParam as J, type InfiniteQueryPageParamsOptions as K, type QueryObserverOptions as L, MutationCache as M, type NoInfer as N, type DefaultedQueryObserverOptions as O, type PlaceholderDataFunction as P, QueryCache as Q, type Register as R, type InfiniteQueryObserverOptions as S, type ThrowOnError as T, type Updater as U, type DefaultedInfiniteQueryObserverOptions as V, type WithRequired as W, type FetchQueryOptions as X, type FetchInfiniteQueryOptions as Y, type ResultOptions as Z, type RefetchOptions as _, type QueryCacheNotifyEvent as a, type RetryDelayValue as a$, type RefetchQueryFilters as a0, type InvalidateOptions as a1, type ResetOptions as a2, type FetchNextPageOptions as a3, type FetchPreviousPageOptions as a4, type QueryStatus as a5, type FetchStatus as a6, type QueryObserverBaseResult as a7, type QueryObserverLoadingResult as a8, type QueryObserverLoadingErrorResult as a9, type DefaultOptions as aA, type CancelOptions as aB, type SetDataOptions as aC, type NotifyEventType as aD, type NotifyEvent as aE, type QueryBehavior as aF, type ObserverFetchOptions as aG, type NotifyOptions as aH, type QueryTypeFilter as aI, noop as aJ, functionalUpdate as aK, isValidTimeout as aL, timeUntilStale as aM, matchMutation as aN, hashQueryKeyByOptions as aO, partialMatchKey as aP, shallowEqualObjects as aQ, isPlainArray as aR, isPlainObject as aS, sleep as aT, replaceData as aU, addToEnd as aV, addToStart as aW, type Action$1 as aX, getDefaultState as aY, type Retryer as aZ, type RetryValue as a_, type QueryObserverRefetchErrorResult as aa, type QueryObserverSuccessResult as ab, type DefinedQueryObserverResult as ac, type QueryObserverResult as ad, type InfiniteQueryObserverBaseResult as ae, type InfiniteQueryObserverLoadingResult as af, type InfiniteQueryObserverLoadingErrorResult as ag, type InfiniteQueryObserverRefetchErrorResult as ah, type InfiniteQueryObserverSuccessResult as ai, type DefinedInfiniteQueryObserverResult as aj, type InfiniteQueryObserverResult as ak, type MutationKey as al, type MutationStatus as am, type MutationMeta as an, type MutationFunction as ao, type MutationOptions as ap, type MutationObserverOptions as aq, type MutateOptions as ar, type MutateFunction as as, type MutationObserverBaseResult as at, type MutationObserverIdleResult as au, type MutationObserverLoadingResult as av, type MutationObserverErrorResult as aw, type MutationObserverSuccessResult as ax, type MutationObserverResult as ay, type QueryClientConfig as az, QueryClient as b, canFetch as b0, createRetryer as b1, type FetchContext as b2, type FetchDirection as b3, type FetchMeta as b4, type FetchOptions as b5, type Action as b6, type SetStateOptions as b7, type QueryStore as b8, QueryObserver as c, type MutationCacheNotifyEvent as d, MutationObserver as e, type MutationFilters as f, type QueryFilters as g, hashKey as h, isServer as i, isCancelledError as j, keepPreviousData as k, type QueryState as l, matchQuery as m, Query as n, Mutation as o, type MutationState as p, type QueryKey as q, replaceEqualDeep as r, dataTagSymbol as s, type DataTag as t, type QueryFunction as u, type QueryPersister as v, type QueryFunctionContext as w, type QueriesPlaceholderDataFunction as x, type QueryKeyHashFunction as y, type GetNextPageParamFunction as z };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import './subscribable.cjs';
|
|
2
|
-
export { aH as NotifyOptions, aG as ObserverFetchOptions, c as QueryObserver } from './queryClient-
|
|
2
|
+
export { aH as NotifyOptions, aG as ObserverFetchOptions, c as QueryObserver } from './queryClient-ZM0hKLC_.cjs';
|
|
3
3
|
import './removable.cjs';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import './subscribable.js';
|
|
2
|
-
export { aH as NotifyOptions, aG as ObserverFetchOptions, c as QueryObserver } from './queryClient-
|
|
2
|
+
export { aH as NotifyOptions, aG as ObserverFetchOptions, c as QueryObserver } from './queryClient-mVGWb1w6.js';
|
|
3
3
|
import './removable.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { C as CancelledError,
|
|
1
|
+
export { C as CancelledError, a$ as RetryDelayValue, a_ as RetryValue, aZ as Retryer, b0 as canFetch, b1 as createRetryer, j as isCancelledError } from './queryClient-ZM0hKLC_.cjs';
|
|
2
2
|
import './removable.cjs';
|
|
3
3
|
import './subscribable.cjs';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { C as CancelledError,
|
|
1
|
+
export { C as CancelledError, a$ as RetryDelayValue, a_ as RetryValue, aZ as Retryer, b0 as canFetch, b1 as createRetryer, j as isCancelledError } from './queryClient-mVGWb1w6.js';
|
|
2
2
|
import './removable.js';
|
|
3
3
|
import './subscribable.js';
|
package/build/modern/types.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { aB as CancelOptions, t as DataTag, D as DefaultError, aA as DefaultOptions, V as DefaultedInfiniteQueryObserverOptions, O as DefaultedQueryObserverOptions, aj as DefinedInfiniteQueryObserverResult, ac as DefinedQueryObserverResult, Y as FetchInfiniteQueryOptions, a3 as FetchNextPageOptions, a4 as FetchPreviousPageOptions, X as FetchQueryOptions, a6 as FetchStatus, z as GetNextPageParamFunction, G as GetPreviousPageParamFunction, A as InfiniteData, ae as InfiniteQueryObserverBaseResult, ag as InfiniteQueryObserverLoadingErrorResult, af as InfiniteQueryObserverLoadingResult, S as InfiniteQueryObserverOptions, ah as InfiniteQueryObserverRefetchErrorResult, ak as InfiniteQueryObserverResult, ai as InfiniteQueryObserverSuccessResult, K as InfiniteQueryPageParamsOptions, I as InitialDataFunction, J as InitialPageParam, a1 as InvalidateOptions, $ as InvalidateQueryFilters, as as MutateFunction, ar as MutateOptions, ao as MutationFunction, al as MutationKey, an as MutationMeta, at as MutationObserverBaseResult, aw as MutationObserverErrorResult, au as MutationObserverIdleResult, av as MutationObserverLoadingResult, aq as MutationObserverOptions, ay as MutationObserverResult, ax as MutationObserverSuccessResult, ap as MutationOptions, am as MutationStatus, E as NetworkMode, N as NoInfer, aE as NotifyEvent, aD as NotifyEventType, F as NotifyOnChangeProps, P as PlaceholderDataFunction, x as QueriesPlaceholderDataFunction, az as QueryClientConfig, u as QueryFunction, w as QueryFunctionContext, q as QueryKey, y as QueryKeyHashFunction, B as QueryMeta, a7 as QueryObserverBaseResult, a9 as QueryObserverLoadingErrorResult, a8 as QueryObserverLoadingResult, L as QueryObserverOptions, aa as QueryObserverRefetchErrorResult, ad as QueryObserverResult, ab as QueryObserverSuccessResult, H as QueryOptions, v as QueryPersister, a5 as QueryStatus, _ as RefetchOptions, a0 as RefetchQueryFilters, R as Register, a2 as ResetOptions, Z as ResultOptions, aC as SetDataOptions, T as ThrowOnError, W as WithRequired, s as dataTagSymbol } from './queryClient-
|
|
1
|
+
export { aB as CancelOptions, t as DataTag, D as DefaultError, aA as DefaultOptions, V as DefaultedInfiniteQueryObserverOptions, O as DefaultedQueryObserverOptions, aj as DefinedInfiniteQueryObserverResult, ac as DefinedQueryObserverResult, Y as FetchInfiniteQueryOptions, a3 as FetchNextPageOptions, a4 as FetchPreviousPageOptions, X as FetchQueryOptions, a6 as FetchStatus, z as GetNextPageParamFunction, G as GetPreviousPageParamFunction, A as InfiniteData, ae as InfiniteQueryObserverBaseResult, ag as InfiniteQueryObserverLoadingErrorResult, af as InfiniteQueryObserverLoadingResult, S as InfiniteQueryObserverOptions, ah as InfiniteQueryObserverRefetchErrorResult, ak as InfiniteQueryObserverResult, ai as InfiniteQueryObserverSuccessResult, K as InfiniteQueryPageParamsOptions, I as InitialDataFunction, J as InitialPageParam, a1 as InvalidateOptions, $ as InvalidateQueryFilters, as as MutateFunction, ar as MutateOptions, ao as MutationFunction, al as MutationKey, an as MutationMeta, at as MutationObserverBaseResult, aw as MutationObserverErrorResult, au as MutationObserverIdleResult, av as MutationObserverLoadingResult, aq as MutationObserverOptions, ay as MutationObserverResult, ax as MutationObserverSuccessResult, ap as MutationOptions, am as MutationStatus, E as NetworkMode, N as NoInfer, aE as NotifyEvent, aD as NotifyEventType, F as NotifyOnChangeProps, P as PlaceholderDataFunction, x as QueriesPlaceholderDataFunction, az as QueryClientConfig, u as QueryFunction, w as QueryFunctionContext, q as QueryKey, y as QueryKeyHashFunction, B as QueryMeta, a7 as QueryObserverBaseResult, a9 as QueryObserverLoadingErrorResult, a8 as QueryObserverLoadingResult, L as QueryObserverOptions, aa as QueryObserverRefetchErrorResult, ad as QueryObserverResult, ab as QueryObserverSuccessResult, H as QueryOptions, v as QueryPersister, a5 as QueryStatus, _ as RefetchOptions, a0 as RefetchQueryFilters, R as Register, a2 as ResetOptions, Z as ResultOptions, aC as SetDataOptions, T as ThrowOnError, W as WithRequired, s as dataTagSymbol } from './queryClient-ZM0hKLC_.cjs';
|
|
2
2
|
import './removable.cjs';
|
|
3
3
|
import './subscribable.cjs';
|
package/build/modern/types.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { aB as CancelOptions, t as DataTag, D as DefaultError, aA as DefaultOptions, V as DefaultedInfiniteQueryObserverOptions, O as DefaultedQueryObserverOptions, aj as DefinedInfiniteQueryObserverResult, ac as DefinedQueryObserverResult, Y as FetchInfiniteQueryOptions, a3 as FetchNextPageOptions, a4 as FetchPreviousPageOptions, X as FetchQueryOptions, a6 as FetchStatus, z as GetNextPageParamFunction, G as GetPreviousPageParamFunction, A as InfiniteData, ae as InfiniteQueryObserverBaseResult, ag as InfiniteQueryObserverLoadingErrorResult, af as InfiniteQueryObserverLoadingResult, S as InfiniteQueryObserverOptions, ah as InfiniteQueryObserverRefetchErrorResult, ak as InfiniteQueryObserverResult, ai as InfiniteQueryObserverSuccessResult, K as InfiniteQueryPageParamsOptions, I as InitialDataFunction, J as InitialPageParam, a1 as InvalidateOptions, $ as InvalidateQueryFilters, as as MutateFunction, ar as MutateOptions, ao as MutationFunction, al as MutationKey, an as MutationMeta, at as MutationObserverBaseResult, aw as MutationObserverErrorResult, au as MutationObserverIdleResult, av as MutationObserverLoadingResult, aq as MutationObserverOptions, ay as MutationObserverResult, ax as MutationObserverSuccessResult, ap as MutationOptions, am as MutationStatus, E as NetworkMode, N as NoInfer, aE as NotifyEvent, aD as NotifyEventType, F as NotifyOnChangeProps, P as PlaceholderDataFunction, x as QueriesPlaceholderDataFunction, az as QueryClientConfig, u as QueryFunction, w as QueryFunctionContext, q as QueryKey, y as QueryKeyHashFunction, B as QueryMeta, a7 as QueryObserverBaseResult, a9 as QueryObserverLoadingErrorResult, a8 as QueryObserverLoadingResult, L as QueryObserverOptions, aa as QueryObserverRefetchErrorResult, ad as QueryObserverResult, ab as QueryObserverSuccessResult, H as QueryOptions, v as QueryPersister, a5 as QueryStatus, _ as RefetchOptions, a0 as RefetchQueryFilters, R as Register, a2 as ResetOptions, Z as ResultOptions, aC as SetDataOptions, T as ThrowOnError, W as WithRequired, s as dataTagSymbol } from './queryClient-
|
|
1
|
+
export { aB as CancelOptions, t as DataTag, D as DefaultError, aA as DefaultOptions, V as DefaultedInfiniteQueryObserverOptions, O as DefaultedQueryObserverOptions, aj as DefinedInfiniteQueryObserverResult, ac as DefinedQueryObserverResult, Y as FetchInfiniteQueryOptions, a3 as FetchNextPageOptions, a4 as FetchPreviousPageOptions, X as FetchQueryOptions, a6 as FetchStatus, z as GetNextPageParamFunction, G as GetPreviousPageParamFunction, A as InfiniteData, ae as InfiniteQueryObserverBaseResult, ag as InfiniteQueryObserverLoadingErrorResult, af as InfiniteQueryObserverLoadingResult, S as InfiniteQueryObserverOptions, ah as InfiniteQueryObserverRefetchErrorResult, ak as InfiniteQueryObserverResult, ai as InfiniteQueryObserverSuccessResult, K as InfiniteQueryPageParamsOptions, I as InitialDataFunction, J as InitialPageParam, a1 as InvalidateOptions, $ as InvalidateQueryFilters, as as MutateFunction, ar as MutateOptions, ao as MutationFunction, al as MutationKey, an as MutationMeta, at as MutationObserverBaseResult, aw as MutationObserverErrorResult, au as MutationObserverIdleResult, av as MutationObserverLoadingResult, aq as MutationObserverOptions, ay as MutationObserverResult, ax as MutationObserverSuccessResult, ap as MutationOptions, am as MutationStatus, E as NetworkMode, N as NoInfer, aE as NotifyEvent, aD as NotifyEventType, F as NotifyOnChangeProps, P as PlaceholderDataFunction, x as QueriesPlaceholderDataFunction, az as QueryClientConfig, u as QueryFunction, w as QueryFunctionContext, q as QueryKey, y as QueryKeyHashFunction, B as QueryMeta, a7 as QueryObserverBaseResult, a9 as QueryObserverLoadingErrorResult, a8 as QueryObserverLoadingResult, L as QueryObserverOptions, aa as QueryObserverRefetchErrorResult, ad as QueryObserverResult, ab as QueryObserverSuccessResult, H as QueryOptions, v as QueryPersister, a5 as QueryStatus, _ as RefetchOptions, a0 as RefetchQueryFilters, R as Register, a2 as ResetOptions, Z as ResultOptions, aC as SetDataOptions, T as ThrowOnError, W as WithRequired, s as dataTagSymbol } from './queryClient-mVGWb1w6.js';
|
|
2
2
|
import './removable.js';
|
|
3
3
|
import './subscribable.js';
|
package/build/modern/utils.cjs
CHANGED
|
@@ -36,7 +36,6 @@ __export(utils_exports, {
|
|
|
36
36
|
partialMatchKey: () => partialMatchKey,
|
|
37
37
|
replaceData: () => replaceData,
|
|
38
38
|
replaceEqualDeep: () => replaceEqualDeep,
|
|
39
|
-
scheduleMicrotask: () => scheduleMicrotask,
|
|
40
39
|
shallowEqualObjects: () => shallowEqualObjects,
|
|
41
40
|
sleep: () => sleep,
|
|
42
41
|
timeUntilStale: () => timeUntilStale
|
|
@@ -201,9 +200,6 @@ function sleep(ms) {
|
|
|
201
200
|
setTimeout(resolve, ms);
|
|
202
201
|
});
|
|
203
202
|
}
|
|
204
|
-
function scheduleMicrotask(callback) {
|
|
205
|
-
sleep(0).then(callback);
|
|
206
|
-
}
|
|
207
203
|
function replaceData(prevData, data, options) {
|
|
208
204
|
if (typeof options.structuralSharing === "function") {
|
|
209
205
|
return options.structuralSharing(prevData, data);
|
|
@@ -241,7 +237,6 @@ function addToStart(items, item, max = 0) {
|
|
|
241
237
|
partialMatchKey,
|
|
242
238
|
replaceData,
|
|
243
239
|
replaceEqualDeep,
|
|
244
|
-
scheduleMicrotask,
|
|
245
240
|
shallowEqualObjects,
|
|
246
241
|
sleep,
|
|
247
242
|
timeUntilStale
|