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

@zestia/ember-simple-infinite-scroller

Package Overview
Dependencies
Maintainers
3
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zestia/ember-simple-infinite-scroller

Simple infinite scroller component for Ember apps

  • 9.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

@zestia/ember-simple-infinite-scroller

Latest npm release Ember Observer

This Ember addon provides a simple component that fires an action whenever it is scrolled to the bottom. Allowing you to load more data.

Installation

ember install @zestia/ember-simple-infinite-scroller

Demo

https://zestia.github.io/ember-simple-infinite-scroller

Example

<InfiniteScroller @onLoadMore={{this.loadMore}} as |scroller|>
  {{#each things as |thing|}}
    ...
  {{/each}}
  {{if scroller.isLoading 'Please wait...'}}
</InfiniteScroller>

Features

  • Very simple! ✔︎
  • Not coupled to Ember Data ✔︎
  • Supports use with FastBoot ✔︎

Notes

  • This addon intentionally does not come with any styles.

InfiniteScroller

Arguments

@onLoadMore

Required. Fired when the the element has been scrolled to the specified @percent.

@element

Optional. By default the scroll position of the component's own DOM element is monitored. You can use this argument to change the element, to monitor the document for example.

@percent

Optional. The distance that has to be scrolled before the load more action is fired. Defaults to 100%

@debounce

Optional. Milliseconds delay for when to check if more needs to be loaded. Defaults to every 100ms

API

isLoading

Whether the promise for more data has resolved yet

isScrollable

Whether the element is overflowing or not. If it's not, then the user will not be able to scroll to load more. In such a case, you can use this boolean to provide a button to manually load more.

loadMore

Call this to manually load more

Testing

A test helper is provided to help scrolling your element

Example
import { scrollToPercentage } from '@zestia/ember-simple-infinite-scroller/test-support/helpers';

test('loading more', async function () {
  await visit('/');
  await scrollToPercentage('.infinite-scroller', 100);
  // ...
});

Performance

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

You may need to add the below code to app/app.js

View
customEvents = {
  touchstart: null,
  touchmove: null,
  touchend: null,
  touchcancel: null
};

Keywords

FAQs

Package last updated on 04 Jul 2023

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