npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ember-infinite-scroller

v0.1.1

Published

Ember Infinite Scroller is a component that sits at the bottom of a page of content. It calls `store.find` to get more content and pushes the content into a model when a user scrolls to the bottom.

Downloads

3

Readme

Ember Infinite Scroller

Ember Infinite Scroller is a component that sits at the bottom of a page of content. It calls store.find to get more content and pushes the content into a model when a user scrolls to the bottom.

Installation

  • Install addon npm install ember-infinite-scroller --save-dev
  • Generate template and styles ember g infinite-scroller

Implementation

Drop the infinite scroller component into any template. There is one required param: contextController. In most cases it will be this.

{{infinite-scroller contextController=this}}

Other parameters are optional.

  • limit default: 12
{{infinite-scroller contextController=this limit=30}}
  • beginInfinite default: true

Use beginInfinite to start or stop manually. For example:

Template:

<button {{action 'toggleBeginInfinite'}}>Begin</button>
{{infinite-scroller  contextController=this beginInfinite=beginInfinite}}

Controller:

actions: {
  toggleBeginInfinite: function() {
    this.toggleProperty('beginInfinite')
  }
}
  • content default: the content of the contextController

The content can be customized if the content of the infinite scroller is not the model of the controller.

{{infinite-scroller contextController=this content=otherModel}}
  • modelName default: the name of the model of the content

If the infinite scroller should query a different model than the content of the content, it can be overwritten.

For example, if the content model type is 'note' but the query should be for 'comment':

{{infinite-scroller contextController=this modelName='comment'}}
  • query default:
{model: this.get('modelName'), params: {}, callback: null}

The query has a required modelName and params and an optional callback.

{{infinite-scroller contextController=this query=query}}

Controller:

query: function() {
  var query = {
    model: 'post',
    params: {published: true},
    callback: function(posts) {
      // do cool things with posts when they come back.
    }
  };
  return query;
}

Blueprint

The blueprint template comes with some handy features, including a yield that is displayed when the infinite scroller is out of content.

{{infinite-scroller contextController=this}}
  <span>No more content!</span>
{{/infinite-scroller}}

It also includes a loading spnner When the scroller is fetching content, it displays a spinner. The default is an image, but you can customize the css to change the spinner.