This is a follow up PR of #701 to add helper methods to the auto pagination functionality. Similar to the advanced usage of the nodejs implementation.
In general this PR allows to chain methods onto the getAutoPaginator() method call in order to manipulate items within the collection. The available methods are
all() -> returns the current page items as array
get() -> enables to receive a specific item from the collection
filter() -> filters through all entries and generates a new collection from the filtered result
first() -> returns first item of the collection passing the given truth test
map() -> returns the mapped collection for the given callback
take() -> returns a new collection with only X items
every() -> determines if all items of the collection pass a given truth test
count() -> receive the count of the current collection items
This is a follow up PR of #701 to add helper methods to the auto pagination functionality. Similar to the advanced usage of the nodejs implementation.
In general this PR allows to chain methods onto the
getAutoPaginator()
method call in order to manipulate items within the collection. The available methods areall()
-> returns the current page items as arrayget()
-> enables to receive a specific item from the collectionfilter()
-> filters through all entries and generates a new collection from the filtered resultfirst()
-> returns first item of the collection passing the given truth testmap()
-> returns the mapped collection for the given callbacktake()
-> returns a new collection with only X itemsevery()
-> determines if all items of the collection pass a given truth testcount()
-> receive the count of the current collection itemsThis new approach allows for the following usages