Options
All
  • Public
  • Public/Protected
  • All
Menu

This class represents a query who's result is cached by a Store.

Do not instantiate this class directly. Instead, get an instance from Store.createQuery.

Type parameters

  • TRequestBody

  • TResult

Hierarchy

  • Query

Index

Constructors

Properties

Constructors

constructor

  • new Query<TRequestBody, TResult>(resolver: Resolver<TRequestBody, TResult>, body: TRequestBody, getter: (body: TRequestBody) => CacheResult<TResult>, setter: (body: TRequestBody, value: TResult) => void): Query<TRequestBody, TResult>
  • This constructor is for internal use only. No guarantees are made that it will not change in non-breaking releases

    Type parameters

    • TRequestBody

    • TResult

    Parameters

    • resolver: Resolver<TRequestBody, TResult>
    • body: TRequestBody
    • getter: (body: TRequestBody) => CacheResult<TResult>
        • (body: TRequestBody): CacheResult<TResult>
        • Parameters

          • body: TRequestBody

          Returns CacheResult<TResult>

    • setter: (body: TRequestBody, value: TResult) => void
        • (body: TRequestBody, value: TResult): void
        • Parameters

          • body: TRequestBody
          • value: TResult

          Returns void

    Returns Query<TRequestBody, TResult>

Properties

getResult

getResult: (forceRefetch?: boolean) => Promise<TResult> = ...

Returns the result of the query. This function will cache the result by default if the body has not changed since the last fetch.

Type declaration

    • (forceRefetch?: boolean): Promise<TResult>
    • Returns the result of the query. This function will cache the result by default if the body has not changed since the last fetch.

      Parameters

      • Optional forceRefetch: boolean

        Determines whether to recompute the query, even if the cache is valid.

      Returns Promise<TResult>

      TResult - The result of the query.

Legend

  • Constructor
  • Property

Generated using TypeDoc