Contains the function
makeCollectionPaginationViewSelector
that can be used to select all the entities that should be visible according to the current
view pagination in the collectionPaginationViewsReducer
Methods
-
makeCollectionPaginationViewSelector(collectionPaginationViewId)
-
Returns a new reselect selector that can be used to get all the entities that should be visible according to the current view pagination in the
collectionPaginationViewsReducer.Parameters:
Name Type Description collectionPaginationViewIdstring The id for the collectionPaginationView to read from
Returns:
The selector. See
collectionPaginationViewSelector- Type
- collectionPaginationViewSelector
Example
// CommunityOverview/index.js const connector = connect( () => { const collectionPaginationViewSelector = makeCollectionPaginationViewSelector( POST_OVERVIEW ); return (state) => { const posts = collectionPaginationViewSelector(state); return { posts: posts.entities, pagination: posts.pagination, }; }; }, );
Type Definitions
-
collectionPaginationViewSelector(state)
-
Selector returned by
makeCollectionPaginationViewSelectorParameters:
Name Type Description stateObject The current redux state
Returns:
An object containing the selector data. See
CollectionPaginationViewSelectorResult- Type
- CollectionPaginationViewSelectorResult
-
CollectionPaginationViewSelectorResult
-
Result returned by a
collectionPaginationViewSelector- Source:
Properties:
Name Type Description entitiesArray.<Object> An array of data for the entities that are currently in view, if found in the
entitiesSelectorentityRefsArray.<Object> An array of the entities that are currently in view
entityRefs[].idstring The id of the entity
entityRefs[].typestring The type of the entity
entityRefs[].data* The entity data, if found in the
entitiesSelector. Note that this is a reference to the same object as the one in theentitiesarray, but it is also included here for convenienceallEntityRefsArray.<Object> An array of all entities in the collection
allEntityRefs[].idstring The id of the entity
allEntityRefs[].typestring The type of the entity
allEntityRefs[].data* The entity data, if found in the
entitiesSelectorpaginationObject An object with view pagination info