sclazy

0.0.5 • Public • Published

sclazy

scroll + lazy

example

in riot

this.on('mount', function() {
  this.sclazy = Sclazy({
    target: this.refs.content,
    onload: () => {
      ref.child('items').get({
        page: this.sclazy.page++,
        per: 32,
      }).then((res) => {
        this.sclazy.addItems(res.data.items);
        this.sclazy.next(res.data.page_info.next_page != null);
        this.update();
      });
    },
    onscrollend: () => {
      this.sclazy.load();
    },
    onpulldown: () => {
      this.sclazy.reset().load();
      this.update();
    },
  });

  this.sclazy.load();
  this.update();
});

ref

Readme

Keywords

none

Package Sidebar

Install

npm i sclazy

Weekly Downloads

9

Version

0.0.5

License

MIT

Unpacked Size

16.9 kB

Total Files

9

Last publish

Collaborators

  • phi