object UseSharedCallReturnType.
function QueryCallComponent() {
const { call, data, loading } = useQueryCall({
functionName: 'getUserProfile',
args: ['123'],
refetchOnMount: true,
refetchInterval: 5000, // refetch every 5 seconds
});
if (loading) return <p>Loading profile...</p>;
return (
<div>
<p>User Profile: {JSON.stringify(data)}</p>
<button onClick={call}>Refetch</button>
</div>
);
}
Hook for making query calls to actors. It supports automatic refetching on component mount and at specified intervals.