• A hook for tracking the RequestResult of a request. It provides a reference to a refresh function.

    Type Parameters

    • ResolveType

    • ExecutorArgs extends unknown[]

    Parameters

    • store: Store<StateWithCachePartition<RequestResult<ResolveType>, string>>

      The Store to use for cacheing.

    • requestExecutor: ((...args) => Promise<ResolveType>)

      the function that returns with the promise of the XHR request.

        • (...args): Promise<ResolveType>
        • Parameters

          • Rest ...args: ExecutorArgs

          Returns Promise<ResolveType>

    • Rest ...currentArgs: ExecutorArgs

      the arguments the requestExecutor will be called with

    Returns [RequestResult<Immutable<ResolveType>>, (() => Promise<unknown>)]

    a tuple with the current RequestResult and the reference to a refresh function. Calling this function will do subsequent requests that are cache-managed.

Generated using TypeDoc