Overview
useCollectionEntitiesWrapper fetches the paginated list of entities saved in a collection. It supports multiple sort modes and infinite-scroll pagination via loadMore.
If no collectionId is passed, it defaults to the current collection from the Redux collections state (i.e., whatever useCollections is currently navigated to).
Usage Example
Parameters
string | null
The collection to fetch entities from. Defaults to the current collection in Redux state.
number
Number of entities per page. Default:
20."new" | "top" | "hot" | "added"
Initial sort mode. Default:
"added" (sorted by when the entity was saved)."asc" | "desc"
Initial sort direction. Default:
"desc".EntityIncludeParam
Optional associations to include with each entity (e.g.,
"user", "space", "topcomment").Returns
Entity[]
The current list of fetched entities. Appended to on each
loadMore call.boolean
true while fetching the initial page or loading more.boolean
true if additional pages are available."new" | "top" | "hot" | "added"
Current sort mode.
"asc" | "desc"
Current sort direction.
(sortBy: 'new' | 'top' | 'hot' | 'added') => void
Change the sort mode. Resets the entity list and re-fetches from page 1.
(sortDir: 'asc' | 'desc') => void
Change the sort direction. Resets the entity list and re-fetches from page 1.
() => void
Load the next page of entities. Appends to the existing list.
() => void
Reset and re-fetch from page 1.

