Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ampersand-pagination-mixin

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ampersand-pagination-mixin

A simple mixin to be used with ampersand-rest-collection, to perform paginated requests

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

js-semistandard-style Dependency Status devDependency Status

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 = require('ampersand-pagination-mixin');
  var RestCollection = require('ampersand-rest-collection');
  var MyModel = require('./MyModel');

  var PaginatedCollection = RestCollection.extend(InfiniteScrollMixin, {
    model: MyModel,
    url: '/api/paginated-resource'
  });
  
  var myCollection = new PaginatedCollection();

  // Now just use the method and let it keep the state for you
  myCollection.fetchPage();

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

Keywords

FAQs

Package last updated on 07 Jul 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc