@profiscience/knockout-contrib-bindings-infinite-scroll
v1.1.2
Published
[![Version][npm-version-shield]][npm] [![Dependency Status][david-dm-shield]][david-dm] [![Peer Dependency Status][david-dm-peer-shield]][david-dm-peer] [![Dev Dependency Status][david-dm-dev-shield]][david-dm-dev] [![Downloads][npm-stats-shield]][npm-sta
Downloads
57
Readme
bindings.infiniteScroll
This package is intended for consumption via the @profiscience/knockout-contrib metapackage
Call a function when the end of an element is reached
Usage
<div data-bind="foreach: todos, infiniteScroll: fetchMoreTodos">...</div>
with a custom offset
By default the infinite scroll will trigger 1500px before reaching the bottom of the bound element. This can be customized, for example to preload slower APIs sooner you could define a larger offset.
<div
data-bind="foreach: todos, infiniteScroll: { handler: fetchMoreTodos, offset: 2000 }"
>
...
</div>