Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

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 fetch(fetchOptions: ObserverFetchOptions): Promise<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>;
onQueryUpdate(action: Action<TData, TError>): void;
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;
trackResult(result: QueryObserverResult<TData, TError>): QueryObserverResult<TData, TError>;
updateResult(notifyOptions?: NotifyOptions): void;
}

§Type Parameters

§
TQueryFnData = unknown
[src]
§
TError = unknown
[src]
§
TData = TQueryFnData
[src]
§
TQueryData = TQueryFnData
[src]
§
TQueryKey extends QueryKey = QueryKey
[src]

§Extends

§
Subscribable<QueryObserverListener<TData, TError>>
[src]

§Constructors

§
new QueryObserver(client: QueryClient, options: QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>)
[src]

§Properties

§
clearRefetchInterval
[src]
§
clearStaleTimeout
[src]
§
client
[src]
§
computeRefetchInterval
[src]
§
currentQuery
[src]
§
currentQueryInitialState
[src]
§
currentRefetchInterval
[src]
§
currentResult
[src]
§
currentResultOptions
[src]
§
currentResultState
[src]
§
executeFetch
[src]
§
notify
[src]
§
previousQueryResult
[src]
§
refetchIntervalId
[src]
§
selectError
[src]
§
selectFn
[src]
§
selectResult
[src]
§
staleTimeoutId
[src]
§
trackedProps
[src]
§
updateQuery
[src]
§
updateRefetchInterval
[src]
§
updateStaleTimeout
[src]
§
updateTimers
[src]
§
options: QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>
[src]

§Methods

§
bindMethods(): void protected
[src]
§
createResult(query: Query<TQueryFnData, TError, TQueryData, TQueryKey>, options: QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>): QueryObserverResult<TData, TError> protected
[src]
§
fetch(fetchOptions: ObserverFetchOptions): Promise<QueryObserverResult<TData, TError>> protected
[src]
§
onSubscribe(): void protected
[src]
§
onUnsubscribe(): void protected
[src]
§
destroy(): void
[src]
§
fetchOptimistic(options: QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>): Promise<QueryObserverResult<TData, TError>>
[src]
§
getCurrentQuery(): Query<TQueryFnData, TError, TQueryData, TQueryKey>
[src]
§
getCurrentResult(): QueryObserverResult<TData, TError>
[src]
§
getOptimisticResult(options: DefaultedQueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>): QueryObserverResult<TData, TError>
[src]
§
onQueryUpdate(action: Action<TData, TError>): void
[src]
§
refetch<TPageData>({ refetchPage, ...options }?: RefetchOptions & RefetchPageFilters<TPageData>): Promise<QueryObserverResult<TData, TError>>
[src]
§
remove(): void
[src]
§
setOptions(options?: QueryObserverOptions<TQueryFnData, TError, TData, TQueryData, TQueryKey>, notifyOptions?: NotifyOptions): void
[src]
§
shouldFetchOnReconnect(): boolean
[src]
§
shouldFetchOnWindowFocus(): boolean
[src]
§
trackResult(result: QueryObserverResult<TData, TError>): QueryObserverResult<TData, TError>
[src]
§
updateResult(notifyOptions?: NotifyOptions): void
[src]