Overview
useFetchManyReputationGrantsWrapper wraps useFetchManyReputationGrants into a ready-to-render list: it holds the accumulated grants, tracks loading / hasMore, keeps the target summary, and exposes loadMore and refetch.
Changing any filter prop (or calling refetch) reloads the list from page 1.
The server requires exactly one filter shape. With none supplied — or with two — the hook stays idle rather than issuing a request it knows will fail: grants is empty, summary is null, loading is false, and hasMore is false. That makes it safe to mount with a targetId that hasn’t resolved yet.
Requires the reputation bundle.
Usage Example
refetch after issuing a grant to pull the new row and updated totals.
Parameters
Page size. Defaults to
10. The server’s maximum is 100; a larger value is rejected with 400 reputation-grant/invalid-query rather than clamped.Associations to expand, as a single value or an array. The only value is
"user" — it hydrates both the sender and the recipient.Opt-in per-user space reputation on the hydrated users.
{ spaceId: "context" } scores each user against that grant’s own space. Only spaces the viewer can read count; others read 0. See Reputation.Returns
The accumulated grants, newest first.
{ total, count, viewerTotal } for the target. Populated only on the target filter shape; null otherwise.The last load failure, or
null. Cleared when the next load starts; loadMore() retries it. A SublayError.Load the next page and append it, or retry the load that failed. Does nothing while a load is running or when there is nothing more. Never rejects: a failure lands in
error.Reload from page 1 with the current filters. The loaded grants stay until the new first page replaces them. Never rejects: a failure lands in
error.Chat message targets are private to their conversation. With
targetType: "message", the list is populated only when the logged-in user is a member of that message’s conversation — someone who has left it still counts; for anyone outside it, grants stays empty and summary comes back as { total: 0, count: 0, viewerTotal: 0 } rather than erroring. The recipientId / senderId shapes apply the same test per row, so a user’s own feed keeps the grants made on messages in their own conversations while a caller outside them never sees those rows. Grants on a message moderation has removed are hidden on both shapes, members included. Grants tied to a space the viewer can’t read, or given on an entity or comment they can’t read, are left out of every shape and its summary — see Grants follow space reading. See useFetchManyReputationGrants.A removed entity takes its grants with it. The grants on an entity a moderator removed are hidden from everyone, on every shape: the
targetType: "entity" shape is empty with a zero summary, and recipientId / senderId leave them out. See A removed entity takes its grants with it.summary is set from the first page and is not re-read by loadMore — it describes the whole target, not the rows loaded so far. Because grant lists are never block-filtered, the rows you render always add up to it.
