QueryObserver
class QueryObserver<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> extends Subscribable<QueryObserverListener<TData, TError>> { }
constructor(client: QueryClient, options: QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>);
private clearRefetchInterval;
private clearStaleTimeout;
private client;
private computeRefetchInterval;
private currentQuery;
private currentQueryInitialState;
private currentRefetchInterval?;
private currentResult;
private currentResultOptions?;
private currentResultState?;
private executeFetch;
private notify;
private previousQueryResult?;
private refetchIntervalId?;
private selectError;
private selectFn?;
private selectResult?;
private staleTimeoutId?;
private trackedProps;
private updateQuery;
private updateRefetchInterval;
private updateStaleTimeout;
private updateTimers;
options: QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>;
protected bindMethods(): void;
protected createResult(query: Query<TQueryFnData, TError, TQueryData, TQueryKey>, options: QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>): QueryObserverResult<TData, TError>;
protected onSubscribe(): void;
protected onUnsubscribe(): void;
destroy(): void;
fetchOptimistic(options: QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>): Promise<QueryObserverResult<TData, TError>>;
getCurrentQuery(): Query<TQueryFnData, TError, TQueryData, TQueryKey>;
getCurrentResult(): QueryObserverResult<TData, TError>;
getOptimisticResult(options: DefaultedQueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>): QueryObserverResult<TData, TError>;
refetch<TPageData>({ refetchPage, ...options }?: RefetchOptions & RefetchPageFilters<TPageData>): Promise<QueryObserverResult<TData, TError>>;
remove(): void;
setOptions(options?: QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>, notifyOptions?: NotifyOptions): void;
shouldFetchOnReconnect(): boolean;
shouldFetchOnWindowFocus(): boolean;
§Type Parameters
§Constructors
§
new QueryObserver(client: QueryClient, options: QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>)
[src]§Properties
§
options: QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>
[src]§Methods
§
createResult(query: Query<TQueryFnData, TError, TQueryData, TQueryKey>, options: QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>): QueryObserverResult<TData, TError> protected
[src]§
fetchOptimistic(options: QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>): Promise<QueryObserverResult<TData, TError>>
[src]§
getCurrentResult(): QueryObserverResult<TData, TError>
[src]§
getOptimisticResult(options: DefaultedQueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>): QueryObserverResult<TData, TError>
[src]§
refetch<TPageData>({ refetchPage, ...options }?: RefetchOptions & RefetchPageFilters<TPageData>): Promise<QueryObserverResult<TData, TError>>
[src]§
setOptions(options?: QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>, notifyOptions?: NotifyOptions): void
[src]§
trackResult(result: QueryObserverResult<TData, TError>): QueryObserverResult<TData, TError>
[src]§
updateResult(notifyOptions?: NotifyOptions): void
[src]