angular-architects / ngrx-toolkit

Various Extensions for the NgRx Signal Store
MIT License
98 stars 16 forks source link

feat: Add local pagination feature #54

Closed wolfmanfx closed 1 month ago

wolfmanfx commented 1 month ago

This commit adds the implementation for local pagination in the withPagination function. It allows for displaying a subset of items from a larger collection, based on the current page and page size.

The withPagination function accepts an optional collection parameter to support multiple paginated collections. It calculates the selected page entities, total count, total pages, and page navigation array based on the provided options.

Additionally, utility functions like gotoPage, setPageSize, nextPage, previousPage, firstPage, and setMaxPageNavigationArrayItems are provided to easily update the pagination state.