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
The collection to fetch entities from. Defaults to the current collection in Redux state.
Initial sort mode. Default:
"added" (sorted by when the entity was saved).Optional associations to include with each entity:
"user", "space", "topComment", "files", "grants". ("saved" is not needed: every entity returned already has isSaved: true.)Returns
Change the sort mode. Resets the entity list and re-fetches from page 1.
Change the sort direction. Resets the entity list and re-fetches from page 1.
Sort Modes
The whole collection is sorted before it is paginated, so
loadMore continues the same order.
