Latest Socket ResearchMalicious Chrome Extension Performs Hidden Affiliate Hijacking.Details
Socket
Book a DemoInstallSign in
Socket

infinity-component

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

infinity-component

infinite scrolling with loading and unloading

Source
npmnpm
Version
0.0.2
Version published
Weekly downloads
14
250%
Maintainers
1
Weekly downloads
 
Created
Source

infinity

Unload and reload panes while scrolling. Inspired by airbnb/infinity.

Installation

Install with component(1):

$ component install component/infinity

API

infinity(el)

Initialize infinity with el. el can be either the window or an element with overflow.

infinity.add(el, ...)

Add el to infinity. You may pass any number of arguments to be called with the load and unload functions. The first argument must be the element node.

infinity.add(view.el, view)

infinity.remove(el)

Remove an element from infinity.

infinity.remove(el)

infinity.load(fn)

Add a load function. Defaults to a noop. The arguments passed to add will be passed through load.

infinity.load(function(el, view) {
  // ...
});

infinity.unload(fn)

Add an unload function. Defaults to a noop. The arguments passed to add will be passed through unload.

infinity.unload(function(el, view) {
  // ...
});

infinity.refresh()

Refresh, loading and unloading elements.

Used internally but may need to be called manually if you are programmatically adjusting elements.

infinity.unbind()

Unbind all infinity events

License

MIT

Keywords

scrolling

FAQs

Package last updated on 07 Aug 2013

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