Created
May 18, 2017 22:34
-
-
Save yoshuawuyts/708024b386efe32ab2c7814179167141 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var infiniteElements = require('cool-scroll-element') | |
var html = require('bel') | |
// Create some test data | |
var data = [] | |
for (var i = 0; i < 500; i++) data.push(i) | |
var list = infiniteElements(function (i) { | |
return html` | |
<div id="row-${i}" style="height: 30px"> | |
this is row ${i} | |
</div> | |
` | |
}) | |
// Append to DOM | |
var tree = list.render(data) | |
document.body.appendChild(tree) | |
// Re-render the element | |
list.render(data) | |
list.render(data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment