All Projects → zestia → ember-simple-infinite-scroller

zestia / ember-simple-infinite-scroller

Licence: MIT license
📜 Simple infinite scroll component for Ember apps

Programming Languages

javascript
184084 projects - #8 most used programming language
Handlebars
879 projects
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to ember-simple-infinite-scroller

Ember Impagination
An Ember Addon that puts the fun back in asynchronous, paginated datasets
Stars: ✭ 123 (+251.43%)
Mutual labels:  ember, infinite-scroll
Ember Light Table
Lightweight, contextual component based table for Ember 2.3+
Stars: ✭ 310 (+785.71%)
Mutual labels:  ember, infinite-scroll
react-infinite-scroller
⏬ Infinite scroll component for React in ES6
Stars: ✭ 3,064 (+8654.29%)
Mutual labels:  infinite-scroll
saule
JSON API library for ASP.Net Web API 2.
Stars: ✭ 74 (+111.43%)
Mutual labels:  ember
ember-responsive-image
Automatically generate resized images at build-time, optimized for the responsive web, and using components to render them easily as <picture> elements.
Stars: ✭ 103 (+194.29%)
Mutual labels:  ember
pagination-pager
Ember.js Component for Bootstrap 3 pagination & pager components
Stars: ✭ 56 (+60%)
Mutual labels:  ember
ember-on-modifier
Implements the `{{on eventName this.someAction}}` element modifier from https://github.com/emberjs/rfcs/blob/master/text/0471-on-modifier.md
Stars: ✭ 37 (+5.71%)
Mutual labels:  ember
labs-factfinder
New York City Census Reporting Tool
Stars: ✭ 34 (-2.86%)
Mutual labels:  ember
ember-fastboot-app-tests
FastBoot testing support for Ember apps
Stars: ✭ 17 (-51.43%)
Mutual labels:  ember
ember-lazy-responsive-image
Generate and render responsive, lazy loaded, LQIP enabled images
Stars: ✭ 14 (-60%)
Mutual labels:  ember
ember-browser-services
Services for interacting with browser APIs so that you can have fine-grained control in tests.
Stars: ✭ 44 (+25.71%)
Mutual labels:  ember
ember-yeti-table
Yeti Table
Stars: ✭ 56 (+60%)
Mutual labels:  ember
virtualized-table-for-antd
the virtualized table component for ant design
Stars: ✭ 193 (+451.43%)
Mutual labels:  infinite-scroll
ember-help-wanted
Search help wanted issues in the Ember community
Stars: ✭ 23 (-34.29%)
Mutual labels:  ember
ember-style-modifier
{{style}} element modifier for ember.js
Stars: ✭ 32 (-8.57%)
Mutual labels:  ember
JFrogfy
a simple clone of spotify built in Emberjs octane the music is played with youtube
Stars: ✭ 27 (-22.86%)
Mutual labels:  ember
Vegile
This tool will setting up your backdoor/rootkits when backdoor already setup it will be hidden your spesisifc process,unlimited your session in metasploit and transparent. Even when it killed, it will re-run again. There always be a procces which while run another process,So we can assume that this procces is unstopable like a Ghost in The Shell
Stars: ✭ 601 (+1617.14%)
Mutual labels:  infinite-scroll
ember-cli-concat
An Ember addon that enables you to concatinate Ember CLI's app and vendor files into a single JS file and a single CSS file
Stars: ✭ 31 (-11.43%)
Mutual labels:  ember
jscrambler
Monorepo of Jscrambler's Javascript Client and Integrations
Stars: ✭ 118 (+237.14%)
Mutual labels:  ember
ember-get-config
Get `config/environment` from anywhere, even addons!!!
Stars: ✭ 63 (+80%)
Mutual labels:  ember

@zestia/ember-simple-infinite-scroller

Latest npm release GitHub Actions 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. It is not coupled to Ember-Data like some other infinite scrolling implementations.

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>

Notes

  • Does not use jQuery ✔︎
  • Ember Data Friendly ✔︎
  • Supports use with FastBoot ✔︎
  • No included styles ✔︎

Configuration

Argument Description Default
onLoadMore Action to perform when the @percent scrolled is reached null
element Monitors the scroll position of the given element null
percent Distance scroll from the top for when to fire the load more action 100
debounce Milliseconds delay for when to check if more needs to be loaded 100

Yielded API

The component will yield a hash that provides:

Property Description
isLoading True when the promise for more data has not resolved yet
isScrollable True when scroll element is overflowing
loadMore Action for manually loading 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: TryGhost/Ghost#7934

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

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

Scenario to be aware of

If your scrollable element is displaying 10 things, but they don't cause the element to overflow, then the user won't ever be able to load more - because they won't be able to scroll and therefore the onLoadMore action will never fire.

To account for this, you can display a button for manually loading more...

<InfiniteScroller @onLoadMore={{this.loadMore}} as |scroller|>
  {{#each this.things as |thing|}}
    ...
  {{/each}}

  {{#unless scroller.isScrollable}}
    <button {{on "click" scroller.loadMore}}>Load more</button>
  {{/unless}}
</InfiniteScroller>
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].