# ember-infinite-scroll

> Infinite scroll for your Ember app.

Latest version **0.2.4** (published 2015-07-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install ember-infinite-scroll
pnpm add ember-infinite-scroll
yarn add ember-infinite-scroll
bun add ember-infinite-scroll
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.4 |
| Published | 2015-07-14 |
| First published | 2014-12-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.10.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 18 |
| Author | Jason Kriss |
| Maintainers | jasonkriss |
| Keywords | ember-addon |

## Links

- npm: https://www.npmjs.com/package/ember-infinite-scroll
- Repository: https://github.com/jasonkriss/ember-infinite-scroll
- Issues: https://github.com/jasonkriss/ember-infinite-scroll/issues
- npm.io page: https://npm.io/package/ember-infinite-scroll

## Recent versions

- 0.2.4 (latest) — 2015-07-14
- 0.1.4 — 2014-12-15
- 0.1.3 — 2014-12-11
- 0.1.2 — 2014-12-05
- 0.1.1 — 2014-12-04
- 0.1.0 — 2014-12-02

## README

# ember-infinite-scroll

Infinite scroll for your Ember app.

## Installation

```bash
# From within your ember-cli project
ember install:addon ember-infinite-scroll
```

## Usage

In your template:

```hbs
<ul>
  {{#each}}
    <li>{{name}}</li>
  {{/each}}
</ul>
{{#infinite-scroll content=model hasMore=hasMore}}
  <span>Loading...</span>
{{/infinite-scroll}}
```

Simply display your list of items as you normally would and then add the `infinite-scroll` component directly after. Whatever is provided in the component block will only show up when more content is being fetched.

In the actions hash of your route/controller/component:

```javascript
fetchMore: function(callback) {
  var promise = this.fetchMoreItems();
  callback(promise);
}
```

In order for everything to work correctly, it is critical that the callback function is passed the newly created promise that will resolve with the additional items.

If you need the scrollable element to be something other than `window`, just pass the element's selector as the `scrollable` option:

```hbs
<ul>
  {{#each}}
    <li>{{name}}</li>
  {{/each}}
</ul>
{{#infinite-scroll content=model hasMore=hasMore scrollable='#scrollable'}}
  <span>Loading...</span>
{{/infinite-scroll}}
```

If you don't need to asynchronously	request more data, you may want to follow [this suggestion](https://github.com/jasonkriss/ember-infinite-scroll/issues/5) by [@SirZach](https://github.com/SirZach).

---
_Source: https://npm.io/package/ember-infinite-scroll · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
