Skip to main content

useLazyLoadQueryWithRefresh

Callable

  • useLazyLoadQueryWithRefresh<TQuery, TChainId>(builder: TQuery, options?: ChainHookOptions<TChainId>): [data: TQuery extends Falsy ? any : FalsyGuard<ReturnType<Exclude<TQuery, Falsy>>, FlatHead<InferQueryPayload<Exclude<ReturnType<Exclude<TQuery, Falsy>>, Falsy>>>, any>, refresh: (...args: []) => void]

  • Hook for querying data from chain, returning the response & a refresher function.


    Type parameters

    • TQuery: any
    • TChainId: any

    Parameters

    • builder: TQuery

      The function to create the query

    • optionaloptions: ChainHookOptions<TChainId>

      Additional options

    Returns [data: TQuery extends Falsy ? any : FalsyGuard<ReturnType<Exclude<TQuery, Falsy>>, FlatHead<InferQueryPayload<Exclude<ReturnType<Exclude<TQuery, Falsy>>, Falsy>>>, any>, refresh: (...args: []) => void]

    The data response & a function to refresh it