Experimental
const { called, data, error, loading, execute } = useLazyPublications();
const callback = async () => {
const result = await execute({
where: {
publicationTypes: [PublicationType.Post]
}
});
if (result.isFailure()) {
toast.error(result.error.message);
return;
}
const publications = result.value;
// do something with the publications
}
useLazyPublications
is a lazy version of usePublications React Hook.This version doesn't support pagination!
This hook will not fetch publications until the returned function is called.
This hook is experimental and may change in the future.