Skip to main content

Function: usePreprintsByAuthor()

usePreprintsByAuthor(params): UseQueryResult<{ cursor: string; hasMore: boolean; preprints: object[]; total: number; }, Error>

Defined in: web/lib/hooks/use-preprint.ts:205

Fetches preprints authored by a specific user.

Parameters

params

UsePreprintsByAuthorParams

Query parameters including author DID

Returns

UseQueryResult<{ cursor: string; hasMore: boolean; preprints: object[]; total: number; }, Error>

Query result with author's preprints

Remarks

Queries preprints by the author's DID. Only enabled when a valid DID is provided.

Example

const { data, isLoading } = usePreprintsByAuthor({
did: 'did:plc:abc123',
limit: 10,
});

return (
<AuthorPreprints
preprints={data?.preprints ?? []}
isLoading={isLoading}
/>
);

Throws

When the author preprints API request fails