ampersand-pagination-mixin
A simple mixin to be used with ampersand collection to perform paginated requests. This module assumes you somehow implement a restful method collection.fetch()
therefore being a perfect match to be used with ampersand-rest-collection. It works by inserting a skip
and limit
fields on the query component of the URI.
Example:
var InfiniteScrollMixin = ; var RestCollection = ; var MyModel = ; var PaginatedCollection = RestCollection; var myCollection = ; // Now just use the method and let it keep the state for you myCollection;
To use this collection with a infinite scroll view use ampersand-infinite-scroll as it works out of the box with it.
credits
Created by @JGAntunes, with the support of @SINFO.
license
MIT