Socket
Book a DemoInstallSign in
Socket

ember-simple-infinite-scroller

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-simple-infinite-scroller

Simple infinite scroller component for Ember apps

latest
Source
npmnpm
Version
1.0.12
Version published
Maintainers
1
Created
Source

ember-simple-infinite-scroller

       

This Ember addon provides a simple component that fires an action whenever it is scrolled to the bottom. Allowing you to load more data. It is not coupled to Ember-Data like some other infinite scrolling implementations.

Installation

ember install ember-simple-infinite-scroller

Example usage

{{#infinite-scroller on-load-more=(action 'loadMore') as |scroller|}}
  {{#each things as |thing|}}
    ...
  {{/each}}
  {{if scroller.isLoading 'Please wait...'}}
{{/infinite-scroller}}

Demo

Configuration

AttributeDescriptionDefault
on-load-moreAction to perform when the bottom is scrolled to
use-documentGoes off document scroll rather than the element's scroll positionfalse
trigger-atA percentage of the scrollable height to consider as the 'bottom'"100%"
scroll-debounceMilliseconds delay used to check if the bottom has been scrolled to100 ms
Element vs Document scroll

Either make your component scrollable:

.my-element {
  max-height: 300px;
  overflow-y: auto;
}

OR

Set use-document=true if your component is not scrollable.

{{#infinite-scroller use-document=true}}
  {{! action will fire when the document is scrolled to the bottom }}
{{/infinite-scroller}}

Yielded API

The component will yield a hash that provides:

PropertyDescription
isLoadingTrue when the promise for more data has not resolved yet
errorThe caught error from the last attempt to load more
loadMoreAction for manually loading more

Performance

Please read: https://github.com/TryGhost/Ghost/issues/7934

You may need to add this to app/app.js

customEvents: {
  touchstart: null,
  touchmove: null,
  touchend: null,
  touchcancel: null
}

Keywords

ember-addon

FAQs

Package last updated on 02 Dec 2017

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.