useEvaQuery
#
DescriptionUse this hook to query an EVA service.
This hook makes sure that it only gets called when a request is present or when the request changes.
caution
The hook must be used within EvaQueryProvider
#
UsageYou could create a custom service hook like this:
import { useEvaQuery } from '@springtree/eva-suite-react-hooks';
type Request = EVA.Core.GetOrder;type Response = EVA.Core.GetOrderResponse
const useGetOrderQuery = (request?: Request) => useEvaQuery<EVA.Core.GetOrder, Response>( Core.GetOrder, 'Core:GetOrder', request, { enabled: !!request }, );