mutant-scroll
An infinite scroller fed by pull-streams
Last updated 2 years ago by mixmix .
AGPL-3.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install mutant-scroll 
SYNC missed versions from official npm registry.

Mutant-scroll

An infinite scroller for mutant, fed by pull-streams. Heavily inspired by pull-scroll.

Example

const Scroller = require('mutant-scroll')

const scollableContainer = Scroller({
  streamToTop,
  streamToBottom,
  render
})

// => mutant html element <div class='Scroller'>

API

Keys you can provide mutant-scroll:

  • render - a function called on each item to render html
  • streamToTop, streamToBottom - (one required) at least one is required, is expected to be a pull-stream source.
  • classList - (optional) an Array of classes to add to the final element
  • prepend, append - (optional) supply array of html elements to insert before or after the streaming content.
  • updateTop - (optional) a function which is passed (soFar, new) where new is the incoming value from the top stream, and soFar is the scrollers observable Array of values, which you're expected to mutate.
  • updateBottom - (optional) similar to updateTop
  • store - (optional) supply a mutant/array if you want to have external access to it, e.g. for caching
  • comparer - (optional) a function used for the mutant map to compare those things it's rendering over
  • overflowY - (optional) over-ride the default inline style over overflow-y
  • cb - (optional) a callback called when errors happen

Current Tags

  • 1.0.2                                ...           latest (2 years ago)

9 Versions

  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
  • 0.0.6                                ...           2 years ago
  • 0.0.5                                ...           3 years ago
  • 0.0.4                                ...           3 years ago
  • 0.0.3                                ...           3 years ago
  • 0.0.2                                ...           3 years ago
  • 0.0.1                                ...           3 years ago
Downloads
Today 0
This Week 1
This Month 1
Last Day 1
Last Week 0
Last Month 0
Dependencies (4)
Dev Dependencies (0)
None

Copyright 2014 - 2016 © taobao.org |