@tanstack/query-core
Advanced tools
Comparing version 5.0.0-alpha.81 to 5.0.0-alpha.84
@@ -1,5 +0,5 @@ | ||
import type { DefaultedInfiniteQueryObserverOptions, FetchNextPageOptions, FetchPreviousPageOptions, InfiniteData, InfiniteQueryObserverOptions, InfiniteQueryObserverResult, QueryKey, DefaultError } from './types'; | ||
import { QueryObserver } from './queryObserver'; | ||
import type { DefaultError, DefaultedInfiniteQueryObserverOptions, FetchNextPageOptions, FetchPreviousPageOptions, InfiniteData, InfiniteQueryObserverOptions, InfiniteQueryObserverResult, QueryKey } from './types'; | ||
import type { QueryClient } from './queryClient'; | ||
import type { NotifyOptions, ObserverFetchOptions } from './queryObserver'; | ||
import { QueryObserver } from './queryObserver'; | ||
import type { Query } from './query'; | ||
@@ -6,0 +6,0 @@ type InfiniteQueryObserverListener<TData, TError> = (result: InfiniteQueryObserverResult<TData, TError>) => void; |
@@ -1,5 +0,5 @@ | ||
import type { MutationOptions, MutationStatus, MutationMeta, DefaultError } from './types'; | ||
import { Removable } from './removable'; | ||
import type { DefaultError, MutationMeta, MutationOptions, MutationStatus } from './types'; | ||
import type { MutationCache } from './mutationCache'; | ||
import type { MutationObserver } from './mutationObserver'; | ||
import { Removable } from './removable'; | ||
interface MutationConfig<TData, TError, TVariables, TContext> { | ||
@@ -6,0 +6,0 @@ mutationId: number; |
@@ -0,8 +1,8 @@ | ||
import { Mutation } from './mutation'; | ||
import { Subscribable } from './subscribable'; | ||
import type { MutationObserver } from './mutationObserver'; | ||
import type { NotifyEvent, MutationOptions, DefaultError } from './types'; | ||
import type { DefaultError, MutationOptions, NotifyEvent } from './types'; | ||
import type { QueryClient } from './queryClient'; | ||
import type { Action, MutationState } from './mutation'; | ||
import { Mutation } from './mutation'; | ||
import type { MutationFilters } from './utils'; | ||
import { Subscribable } from './subscribable'; | ||
interface MutationCacheConfig { | ||
@@ -9,0 +9,0 @@ onError?: (error: DefaultError, variables: unknown, context: unknown, mutation: Mutation<unknown, unknown, unknown>) => Promise<unknown> | unknown; |
@@ -0,5 +1,5 @@ | ||
import { Subscribable } from './subscribable'; | ||
import type { QueryClient } from './queryClient'; | ||
import type { DefaultError, MutateOptions, MutationObserverOptions, MutationObserverResult } from './types'; | ||
import type { Action } from './mutation'; | ||
import type { QueryClient } from './queryClient'; | ||
import { Subscribable } from './subscribable'; | ||
import type { MutateOptions, MutationObserverResult, MutationObserverOptions, DefaultError } from './types'; | ||
type MutationObserverListener<TData, TError, TVariables, TContext> = (result: MutationObserverResult<TData, TError, TVariables, TContext>) => void; | ||
@@ -6,0 +6,0 @@ export declare class MutationObserver<TData = unknown, TError = DefaultError, TVariables = void, TContext = unknown> extends Subscribable<MutationObserverListener<TData, TError, TVariables, TContext>> { |
@@ -0,6 +1,6 @@ | ||
import { QueryObserver } from './queryObserver'; | ||
import { Subscribable } from './subscribable'; | ||
import type { QueryObserverOptions, QueryObserverResult } from './types'; | ||
import type { QueryClient } from './queryClient'; | ||
import type { NotifyOptions } from './queryObserver'; | ||
import { QueryObserver } from './queryObserver'; | ||
import { Subscribable } from './subscribable'; | ||
type QueriesObserverListener = (result: QueryObserverResult[]) => void; | ||
@@ -7,0 +7,0 @@ export interface QueriesObserverOptions<TCombinedResult = QueryObserverResult[]> { |
@@ -1,5 +0,5 @@ | ||
import type { QueryKey, QueryOptions, QueryStatus, QueryMeta, CancelOptions, SetDataOptions, FetchStatus, DefaultError } from './types'; | ||
import { Removable } from './removable'; | ||
import type { CancelOptions, DefaultError, FetchStatus, QueryKey, QueryMeta, QueryOptions, QueryStatus, SetDataOptions } from './types'; | ||
import type { QueryCache } from './queryCache'; | ||
import type { QueryObserver } from './queryObserver'; | ||
import { Removable } from './removable'; | ||
interface QueryConfig<TQueryFnData, TError, TData, TQueryKey extends QueryKey = QueryKey> { | ||
@@ -6,0 +6,0 @@ cache: QueryCache; |
@@ -0,7 +1,7 @@ | ||
import { Query } from './query'; | ||
import { Subscribable } from './subscribable'; | ||
import type { QueryFilters } from './utils'; | ||
import type { Action, QueryState } from './query'; | ||
import { Query } from './query'; | ||
import type { NotifyEvent, QueryKey, QueryOptions, DefaultError, WithRequired } from './types'; | ||
import type { DefaultError, NotifyEvent, QueryKey, QueryOptions, WithRequired } from './types'; | ||
import type { QueryClient } from './queryClient'; | ||
import { Subscribable } from './subscribable'; | ||
import type { QueryObserver } from './queryObserver'; | ||
@@ -8,0 +8,0 @@ interface QueryCacheConfig { |
@@ -1,6 +0,6 @@ | ||
import type { QueryFilters, Updater, MutationFilters } from './utils'; | ||
import type { QueryClientConfig, DefaultOptions, FetchInfiniteQueryOptions, FetchQueryOptions, InfiniteData, InvalidateOptions, InvalidateQueryFilters, MutationKey, MutationObserverOptions, MutationOptions, QueryKey, QueryObserverOptions, RefetchOptions, RefetchQueryFilters, ResetOptions, SetDataOptions, DefaultError, CancelOptions, DefaultedQueryObserverOptions } from './types'; | ||
import type { QueryState } from './query'; | ||
import { QueryCache } from './queryCache'; | ||
import { MutationCache } from './mutationCache'; | ||
import type { QueryState } from './query'; | ||
import type { CancelOptions, DefaultError, DefaultOptions, DefaultedQueryObserverOptions, FetchInfiniteQueryOptions, FetchQueryOptions, InfiniteData, InvalidateOptions, InvalidateQueryFilters, MutationKey, MutationObserverOptions, MutationOptions, QueryClientConfig, QueryKey, QueryObserverOptions, RefetchOptions, RefetchQueryFilters, ResetOptions, SetDataOptions } from './types'; | ||
import type { MutationFilters, QueryFilters, Updater } from './utils'; | ||
export declare class QueryClient { | ||
@@ -7,0 +7,0 @@ #private; |
@@ -1,5 +0,5 @@ | ||
import type { DefaultedQueryObserverOptions, DefaultError, QueryKey, QueryObserverOptions, QueryObserverResult, RefetchOptions } from './types'; | ||
import type { Query, FetchOptions } from './query'; | ||
import { Subscribable } from './subscribable'; | ||
import type { QueryClient } from './queryClient'; | ||
import { Subscribable } from './subscribable'; | ||
import type { FetchOptions, Query } from './query'; | ||
import type { DefaultError, DefaultedQueryObserverOptions, QueryKey, QueryObserverOptions, QueryObserverResult, RefetchOptions } from './types'; | ||
type QueryObserverListener<TData, TError> = (result: QueryObserverResult<TData, TError>) => void; | ||
@@ -6,0 +6,0 @@ export interface NotifyOptions { |
@@ -1,2 +0,2 @@ | ||
import type { CancelOptions, NetworkMode, DefaultError } from './types'; | ||
import type { CancelOptions, DefaultError, NetworkMode } from './types'; | ||
interface RetryerConfig<TData = unknown, TError = DefaultError> { | ||
@@ -3,0 +3,0 @@ fn: () => TData | Promise<TData>; |
/// <reference types="node" /> | ||
import { QueryClient } from '..'; | ||
import type { MutationOptions, QueryClientConfig } from '..'; | ||
import { QueryClient } from '..'; | ||
export declare function createQueryClient(config?: QueryClientConfig): QueryClient; | ||
@@ -5,0 +5,0 @@ export declare function mockVisibilityState(value: DocumentVisibilityState): import("vitest/dist/index-1cfc7f58").S<[], DocumentVisibilityState>; |
import type { MutationState } from './mutation'; | ||
import type { FetchDirection, QueryBehavior, Query } from './query'; | ||
import type { RetryValue, RetryDelayValue } from './retryer'; | ||
import type { FetchDirection, Query, QueryBehavior } from './query'; | ||
import type { RetryDelayValue, RetryValue } from './retryer'; | ||
import type { QueryFilters, QueryTypeFilter } from './utils'; | ||
@@ -5,0 +5,0 @@ import type { QueryCache } from './queryCache'; |
{ | ||
"name": "@tanstack/query-core", | ||
"version": "5.0.0-alpha.81", | ||
"version": "5.0.0-alpha.84", | ||
"description": "The framework agnostic core that powers TanStack Query", | ||
@@ -5,0 +5,0 @@ "author": "tannerlinsley", |
@@ -0,3 +1,3 @@ | ||
import { addToEnd, addToStart } from './utils' | ||
import type { QueryBehavior } from './query' | ||
import { addToEnd, addToStart } from './utils' | ||
import type { | ||
@@ -4,0 +4,0 @@ InfiniteData, |
@@ -0,2 +1,9 @@ | ||
import { QueryObserver } from './queryObserver' | ||
import { | ||
hasNextPage, | ||
hasPreviousPage, | ||
infiniteQueryBehavior, | ||
} from './infiniteQueryBehavior' | ||
import type { | ||
DefaultError, | ||
DefaultedInfiniteQueryObserverOptions, | ||
@@ -9,12 +16,5 @@ FetchNextPageOptions, | ||
QueryKey, | ||
DefaultError, | ||
} from './types' | ||
import type { QueryClient } from './queryClient' | ||
import type { NotifyOptions, ObserverFetchOptions } from './queryObserver' | ||
import { QueryObserver } from './queryObserver' | ||
import { | ||
hasNextPage, | ||
hasPreviousPage, | ||
infiniteQueryBehavior, | ||
} from './infiniteQueryBehavior' | ||
import type { Query } from './query' | ||
@@ -21,0 +21,0 @@ |
@@ -0,13 +1,13 @@ | ||
import { notifyManager } from './notifyManager' | ||
import { Removable } from './removable' | ||
import { canFetch, createRetryer } from './retryer' | ||
import type { | ||
DefaultError, | ||
MutationMeta, | ||
MutationOptions, | ||
MutationStatus, | ||
MutationMeta, | ||
DefaultError, | ||
} from './types' | ||
import type { MutationCache } from './mutationCache' | ||
import type { MutationObserver } from './mutationObserver' | ||
import { notifyManager } from './notifyManager' | ||
import { Removable } from './removable' | ||
import type { Retryer } from './retryer' | ||
import { canFetch, createRetryer } from './retryer' | ||
@@ -14,0 +14,0 @@ // TYPES |
@@ -0,10 +1,10 @@ | ||
import { notifyManager } from './notifyManager' | ||
import { Mutation } from './mutation' | ||
import { matchMutation, noop } from './utils' | ||
import { Subscribable } from './subscribable' | ||
import type { MutationObserver } from './mutationObserver' | ||
import type { NotifyEvent, MutationOptions, DefaultError } from './types' | ||
import type { DefaultError, MutationOptions, NotifyEvent } from './types' | ||
import type { QueryClient } from './queryClient' | ||
import { notifyManager } from './notifyManager' | ||
import type { Action, MutationState } from './mutation' | ||
import { Mutation } from './mutation' | ||
import type { MutationFilters } from './utils' | ||
import { matchMutation, noop } from './utils' | ||
import { Subscribable } from './subscribable' | ||
@@ -11,0 +11,0 @@ // TYPES |
@@ -1,13 +0,13 @@ | ||
import type { Action, Mutation } from './mutation' | ||
import { getDefaultState } from './mutation' | ||
import { notifyManager } from './notifyManager' | ||
import { Subscribable } from './subscribable' | ||
import { shallowEqualObjects } from './utils' | ||
import type { QueryClient } from './queryClient' | ||
import { Subscribable } from './subscribable' | ||
import type { | ||
DefaultError, | ||
MutateOptions, | ||
MutationObserverOptions, | ||
MutationObserverResult, | ||
MutationObserverOptions, | ||
DefaultError, | ||
} from './types' | ||
import { shallowEqualObjects } from './utils' | ||
import type { Action, Mutation } from './mutation' | ||
@@ -14,0 +14,0 @@ // TYPES |
import { notifyManager } from './notifyManager' | ||
import { QueryObserver } from './queryObserver' | ||
import { Subscribable } from './subscribable' | ||
import { replaceEqualDeep } from './utils' | ||
import type { | ||
DefaultedQueryObserverOptions, | ||
QueryObserverOptions, | ||
QueryObserverResult, | ||
DefaultedQueryObserverOptions, | ||
} from './types' | ||
import type { QueryClient } from './queryClient' | ||
import type { NotifyOptions } from './queryObserver' | ||
import { QueryObserver } from './queryObserver' | ||
import { Subscribable } from './subscribable' | ||
import { replaceEqualDeep } from './utils' | ||
@@ -13,0 +13,0 @@ function difference<T>(array1: T[], array2: T[]): T[] { |
import { noop, replaceData, timeUntilStale } from './utils' | ||
import { notifyManager } from './notifyManager' | ||
import { canFetch, createRetryer, isCancelledError } from './retryer' | ||
import { Removable } from './removable' | ||
import type { | ||
CancelOptions, | ||
DefaultError, | ||
FetchStatus, | ||
InitialDataFunction, | ||
QueryFunctionContext, | ||
QueryKey, | ||
QueryMeta, | ||
QueryOptions, | ||
QueryStatus, | ||
QueryFunctionContext, | ||
QueryMeta, | ||
CancelOptions, | ||
SetDataOptions, | ||
FetchStatus, | ||
DefaultError, | ||
} from './types' | ||
import type { QueryCache } from './queryCache' | ||
import type { QueryObserver } from './queryObserver' | ||
import { notifyManager } from './notifyManager' | ||
import type { Retryer } from './retryer' | ||
import { isCancelledError, canFetch, createRetryer } from './retryer' | ||
import { Removable } from './removable' | ||
@@ -21,0 +21,0 @@ // TYPES |
@@ -0,15 +1,15 @@ | ||
import { hashQueryKeyByOptions, matchQuery } from './utils' | ||
import { Query } from './query' | ||
import { notifyManager } from './notifyManager' | ||
import { Subscribable } from './subscribable' | ||
import type { QueryFilters } from './utils' | ||
import { hashQueryKeyByOptions, matchQuery } from './utils' | ||
import type { Action, QueryState } from './query' | ||
import { Query } from './query' | ||
import type { | ||
DefaultError, | ||
NotifyEvent, | ||
QueryKey, | ||
QueryOptions, | ||
DefaultError, | ||
WithRequired, | ||
} from './types' | ||
import { notifyManager } from './notifyManager' | ||
import type { QueryClient } from './queryClient' | ||
import { Subscribable } from './subscribable' | ||
import type { QueryObserver } from './queryObserver' | ||
@@ -16,0 +16,0 @@ |
@@ -1,12 +0,20 @@ | ||
import type { QueryFilters, Updater, MutationFilters } from './utils' | ||
import { | ||
functionalUpdate, | ||
hashKey, | ||
hashQueryKeyByOptions, | ||
noop, | ||
partialMatchKey, | ||
hashQueryKeyByOptions, | ||
functionalUpdate, | ||
} from './utils' | ||
import { QueryCache } from './queryCache' | ||
import { MutationCache } from './mutationCache' | ||
import { focusManager } from './focusManager' | ||
import { onlineManager } from './onlineManager' | ||
import { notifyManager } from './notifyManager' | ||
import { infiniteQueryBehavior } from './infiniteQueryBehavior' | ||
import type { QueryState } from './query' | ||
import type { | ||
QueryClientConfig, | ||
CancelOptions, | ||
DefaultError, | ||
DefaultOptions, | ||
DefaultedQueryObserverOptions, | ||
FetchInfiniteQueryOptions, | ||
@@ -20,2 +28,3 @@ FetchQueryOptions, | ||
MutationOptions, | ||
QueryClientConfig, | ||
QueryKey, | ||
@@ -28,13 +37,4 @@ QueryObserverOptions, | ||
SetDataOptions, | ||
DefaultError, | ||
CancelOptions, | ||
DefaultedQueryObserverOptions, | ||
} from './types' | ||
import type { QueryState } from './query' | ||
import { QueryCache } from './queryCache' | ||
import { MutationCache } from './mutationCache' | ||
import { focusManager } from './focusManager' | ||
import { onlineManager } from './onlineManager' | ||
import { notifyManager } from './notifyManager' | ||
import { infiniteQueryBehavior } from './infiniteQueryBehavior' | ||
import type { MutationFilters, QueryFilters, Updater } from './utils' | ||
@@ -41,0 +41,0 @@ // TYPES |
@@ -1,12 +0,1 @@ | ||
import type { | ||
DefaultedQueryObserverOptions, | ||
DefaultError, | ||
PlaceholderDataFunction, | ||
QueryKey, | ||
QueryObserverBaseResult, | ||
QueryObserverOptions, | ||
QueryObserverResult, | ||
QueryOptions, | ||
RefetchOptions, | ||
} from './types' | ||
import { | ||
@@ -21,7 +10,18 @@ isServer, | ||
import { notifyManager } from './notifyManager' | ||
import type { Query, QueryState, FetchOptions } from './query' | ||
import type { QueryClient } from './queryClient' | ||
import { focusManager } from './focusManager' | ||
import { Subscribable } from './subscribable' | ||
import { canFetch } from './retryer' | ||
import type { QueryClient } from './queryClient' | ||
import type { FetchOptions, Query, QueryState } from './query' | ||
import type { | ||
DefaultError, | ||
DefaultedQueryObserverOptions, | ||
PlaceholderDataFunction, | ||
QueryKey, | ||
QueryObserverBaseResult, | ||
QueryObserverOptions, | ||
QueryObserverResult, | ||
QueryOptions, | ||
RefetchOptions, | ||
} from './types' | ||
@@ -28,0 +28,0 @@ type QueryObserverListener<TData, TError> = ( |
import { focusManager } from './focusManager' | ||
import { onlineManager } from './onlineManager' | ||
import { sleep } from './utils' | ||
import type { CancelOptions, NetworkMode, DefaultError } from './types' | ||
import type { CancelOptions, DefaultError, NetworkMode } from './types' | ||
@@ -6,0 +6,0 @@ // TYPES |
import { act } from '@testing-library/react' | ||
import { vi } from 'vitest' | ||
import type { MutationOptions, QueryClientConfig } from '..' | ||
import { QueryClient } from '..' | ||
import * as utils from '../utils' | ||
import type { MutationOptions, QueryClientConfig } from '..' | ||
@@ -8,0 +8,0 @@ export function createQueryClient(config?: QueryClientConfig): QueryClient { |
/* istanbul ignore file */ | ||
import type { MutationState } from './mutation' | ||
import type { FetchDirection, QueryBehavior, Query } from './query' | ||
import type { RetryValue, RetryDelayValue } from './retryer' | ||
import type { FetchDirection, Query, QueryBehavior } from './query' | ||
import type { RetryDelayValue, RetryValue } from './retryer' | ||
import type { QueryFilters, QueryTypeFilter } from './utils' | ||
@@ -7,0 +7,0 @@ import type { QueryCache } from './queryCache' |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet