New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

more-mobile

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

more-mobile

do something when element scroll to end

latest
Source
npmnpm
Version
1.3.4
Version published
Weekly downloads
15
400%
Maintainers
1
Weekly downloads
 
Created
Source

More

Build Status Coverage Status

Append more div the list element, check loading on scroll.

demo

Installation

Install with npm:

$ npm install more-mobile

Install with component(1):

$ component install chemzqm/more

Events

  • load is emitted after callback called.

API

var more = require('more')
var el = document.querySelector('ul')
var times = 0
more(el, function() {
  return new Promise(function(resolve, reject) {
    var arr
    // fetch the list
    if (err)return reject()
    if (arr.length) {
      more.disable() //disable loading
    }
    resolve()
  })
})
})

new More(el, callback, [scrollable])

Insert more after list el, call the callback with a function when more div could be visible(or return promise)

scrollable is Object (could be element or other object) which emit scroll event, it default to el.parentNode, could also be window

.disable()

Disable more loading.

.remove()

Remove inserted div and unbind events

.load()

Force more start loading data without scroll event fired (will not load if it's loading or disabled)

Return promise

License

MIT

Keywords

more

FAQs

Package last updated on 30 Nov 2016

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