1.1.2 • Published 4 years ago

@profiscience/knockout-contrib-bindings-infinite-scroll v1.1.2

Weekly downloads
2
License
WTFPL
Repository
github
Last release
4 years ago

bindings.infiniteScroll

Version Dependency Status Peer Dependency Status Dev Dependency Status Downloads

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>