pcpl2 / infinite-scroll-mithril

Infinity scroll component for mithril.js

Home Page:https://github.com/pcpl2/infinite-scroll-mithril

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

infinite-scroll-mithril

nfinite-scroll-mithril BSD-2-Clause License Downloads

Infinity scroll component for mithril

Compatible with Mithril 2.x

Installation

Use as npm module:

npm install infinite-scroll-mithril

or download/clone from Github.

Supported Browsers

This component has required IntersectionObserver API to works.

Edge
Edge
Firefox
Firefox
Chrome
Chrome
Safari
Safari
Opera
Opera
Edge 16+ 55+ 58+ 12.1+ 45+

How to use

Example avaiable on codesandbox.io

Options

Parameter Mandatory Type Default Description
preload optional Boolean Initial loading first page
pageCount required Number 0 Number of elements per page
loadingFooter optional Mithril object Element visible under the list while loading
pageRequest required Function (page: Number) => Promise Function that fetches data; accepts a page number and returns a promise
processPageData required Function (data: Array) => Array Function that creates a Mithril element from received data

About

Infinity scroll component for mithril.js

https://github.com/pcpl2/infinite-scroll-mithril

License:BSD 2-Clause "Simplified" License


Languages

Language:JavaScript 100.0%