Arc.React
    Preparing search index...

    Function useQuery

    • React hook for working with IQueryFor within the state management of React.

      Type Parameters

      • TDataType

        Type of model the query is for.

      • TQuery extends IQueryFor<TDataType>

        Type of query to use.

      • TArguments = object

        Optional: Arguments for the query, if any

      Parameters

      • query: Constructor<TQuery>

        Query type constructor.

      • Optionalargs: TArguments

        Optional: Arguments for the query, if any

      • Optionalsorting: any

        Optional: Sorting for the query, if any

      • OptionalisEnabled: boolean

        Optional: Whether the query should be executed. Defaults to true. When false, the hook is a no-op and returns an empty result.

      Returns [QueryResultWithState<TDataType>, PerformQuery<TArguments>, SetSorting]

      Tuple of QueryResultWithState, a PerformQuery delegate, and a SetSorting delegate.