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

Query

class Query<TQueryFnData = unknown, TError = unknown, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey> extends Removable {
constructor(config: QueryConfig<TQueryFnData, TError, TData, TQueryKey>);
private abortSignalConsumed;
private cache;
private defaultOptions?;
private dispatch;
private logger;
private observers;
private promise?;
private retryer?;
private setOptions;
initialState: QueryState<TData, TError>;
isFetchingOptimistic?: boolean;
meta: QueryMeta | undefined;
options: QueryOptions<TQueryFnData, TError, TData, TQueryKey>;
queryHash: string;
queryKey: TQueryKey;
revertState?: QueryState<TData, TError>;
state: QueryState<TData, TError>;
 
protected optionalRemove(): void;
addObserver(observer: QueryObserver<any, any, any, any, any>): void;
cancel(options?: CancelOptions): Promise<void>;
destroy(): void;
fetch(options?: QueryOptions<TQueryFnData, TError, TData, TQueryKey>, fetchOptions?: FetchOptions): Promise<TData>;
getObserversCount(): number;
invalidate(): void;
isActive(): boolean;
isDisabled(): boolean;
isStale(): boolean;
isStaleByTime(staleTime?: number): boolean;
onFocus(): void;
onOnline(): void;
removeObserver(observer: QueryObserver<any, any, any, any, any>): void;
reset(): void;
setData(newData: TData, options?: SetDataOptions & {
manual: boolean;
}
): TData;
setState(state: QueryState<TData, TError>, setStateOptions?: SetStateOptions): void;
}

§Type Parameters

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

§Extends

§
Removable
[src]

§Constructors

§
new Query(config: QueryConfig<TQueryFnData, TError, TData, TQueryKey>)
[src]

§Properties

§
abortSignalConsumed
[src]
§
cache
[src]
§
defaultOptions
[src]
§
dispatch
[src]
§
logger
[src]
§
observers
[src]
§
promise
[src]
§
retryer
[src]
§
setOptions
[src]
§
initialState: QueryState<TData, TError>
[src]
§
isFetchingOptimistic: boolean
[src]
§
meta: QueryMeta | undefined
[src]
§
options: QueryOptions<TQueryFnData, TError, TData, TQueryKey>
[src]
§
queryHash: string
[src]
§
queryKey: TQueryKey
[src]
§
revertState: QueryState<TData, TError>
[src]
§
state: QueryState<TData, TError>
[src]

§Methods

§
optionalRemove(): void protected
[src]
§
addObserver(observer: QueryObserver<any, any, any, any, any>): void
[src]
§
cancel(options?: CancelOptions): Promise<void>
[src]
§
destroy(): void
[src]
§
fetch(options?: QueryOptions<TQueryFnData, TError, TData, TQueryKey>, fetchOptions?: FetchOptions): Promise<TData>
[src]
§
getObserversCount(): number
[src]
§
invalidate(): void
[src]
§
isActive(): boolean
[src]
§
isDisabled(): boolean
[src]
§
isStale(): boolean
[src]
§
isStaleByTime(staleTime?: number): boolean
[src]
§
onFocus(): void
[src]
§
onOnline(): void
[src]
§
removeObserver(observer: QueryObserver<any, any, any, any, any>): void
[src]
§
reset(): void
[src]
§
setData(newData: TData, options?: SetDataOptions & {
manual: boolean;
}
): TData
[src]
§
setState(state: QueryState<TData, TError>, setStateOptions?: SetStateOptions): void
[src]