Socket
Socket
Sign inDemoInstall

@better-scroll/infinity

Package Overview
Dependencies
Maintainers
3
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@better-scroll/infinity

The ability to inject a infinity load for BetterScroll.


Version published
Weekly downloads
2.1K
decreased by-5.3%
Maintainers
3
Weekly downloads
 
Created
Source

@better-scroll/infinity

中文文档

The ability to inject a infinity load for BetterScroll.

Usage

import BScroll from '@better-scroll/core'
import InfinityScroll from '@better-scroll/infinity'
BScroll.use(InfinityScroll)

const bs = new BScroll('.wrapper', {
  infinity: {
    fetch(count) {
      // Fetch data that is larger than count, the function is asynchronous, and it needs to return a Promise.。
      // After you have successfully fetch the data, you need resolve an array of data (or resolve Promise).
      // Each element of the array is list data, which will be rendered when the render method executes。
      // If there is no data, you can resolve (false) to tell the infinite scroll list that there is no more data。
    }
    render(item, div) {
      // Rendering each element node, item is data, and div is a container for wrapping element nodes.
      // The function needs to return to the rendered DOM node.
    },
    createTombstone() {
      // Returns a tombstone DOM node.。
    }
  }
})

Keywords

FAQs

Package last updated on 29 Mar 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc