Experimental
const { called, data, error, loading, execute } = useLazyProfile();
This hook is experimental and may change in the future.
const { called, data, error, loading, execute } = useLazyProfile();
const callback = async () => {
const result = await execute({ forProfileId: profileId });
if (result.isFailure()) {
toast.error(result.error.message);
return;
}
const profile = result.value;
// do something with profile
}
useLazyProfile
is a lazy version of useProfile React Hook.This hook will not fetch the profile until the returned function is called.
This hook is intended to enable more complex use cases, the vast majority of use cases should use useProfile instead.