Modules: collectionPaginationViewSelector

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

Source:

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
collectionPaginationViewId string

The id for the collectionPaginationView to read from

Source:
Returns:
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)

Parameters:
Name Type Description
state Object

The current redux state

Source:
Returns:

An object containing the selector data. See CollectionPaginationViewSelectorResult

Type
CollectionPaginationViewSelectorResult

CollectionPaginationViewSelectorResult

Result returned by a collectionPaginationViewSelector

Properties:
Name Type Description
entities Array.<Object>

An array of data for the entities that are currently in view, if found in the entitiesSelector

entityRefs Array.<Object>

An array of the entities that are currently in view

entityRefs[].id string

The id of the entity

entityRefs[].type string

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 the entities array, but it is also included here for convenience

allEntityRefs Array.<Object>

An array of all entities in the collection

allEntityRefs[].id string

The id of the entity

allEntityRefs[].type string

The type of the entity

allEntityRefs[].data *

The entity data, if found in the entitiesSelector

pagination Object

An object with view pagination info

Source: