hypermore

2.0.0 • Public • Published

hypermore

more hyper when you click a button.

example

provide a reduce function, a pull stream, and a render function. and then attach obv.more() to a button.

var PullObv = require('pull-obv')
var More = require('hypermore')
var h = require('mutant/h') //or hyperscript
var pull = require('pull-stream')


var obv = More(
  //pass a pull-obv instance as first arg.
  PullObv(function (ary, item) {
    return ary.concat(item)
  }, pull.infinite(), [])
function (list, el) {
  //you might also use morphdom or just mutate the same element.
  return h('ol', list.map(function (n) { return h('li', ''+n) }))
})

document.body.appendChild(
  h('div.content', obv, h('button', {'ev-click': obv.more}, ['Show More']))
)

when you hit call obv.more() it will stream data until the target element takes up the current size + screen height.

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 2.0.0
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 2.0.0
    1
  • 1.1.1
    1
  • 1.1.0
    1
  • 1.0.0
    1

Package Sidebar

Install

npm i hypermore

Weekly Downloads

4

Version

2.0.0

License

MIT

Last publish

Collaborators

  • mixmix
  • dominictarr