Function useQuery

  • React Hook for a query against the ledger.

    Type Parameters

    • T extends object
    • K
    • I extends string

    Parameters

    • template: TemplateOrInterface<T, K, I>

      The contract template or interface to filter for.

    • queryFactory: () => Query<T>

      A function returning a query. If the query is omitted, all visible contracts of the given template are returned.

    • queryDeps: readonly unknown[]

      The dependencies of the query (which trigger a reload when changed).

    Returns QueryResult<T, K, I>

    The result of the query.

    T The contract template or interface type of the query.

    K The contract key type of the query.

    I The template id type.

  • React Hook for a query against the ledger.

    Type Parameters

    • T extends object
    • K
    • I extends string

    Parameters

    • template: TemplateOrInterface<T, K, I>

      The contract template or interface to filter for.

    Returns QueryResult<T, K, I>

    The result of the query.

    T The contract template or interface type of the query.

    K The contract key type of the query.

    I The template id type.