Security News
The Push to Ban Ransom Payments Is Gaining Momentum
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
view-list
Advanced tools
Readme
An infinite scrolling virtual DOM list view.
View a live example displaying 200k rows: http://shama.github.io/view-list
Render the ViewList using virtual-dom:
var ViewList = require('view-list')
var diff = require('virtual-dom/diff')
var patch = require('virtual-dom/patch')
var createElement = require('virtual-dom/create-element')
var raf = require('raf')
// Create an instance of our view list
var viewlist = new ViewList()
// Main render function
function render () {
return viewlist.render(['one', 'two', 'three'])
}
// Initial DOM tree render
var tree = render()
var rootNode = createElement(tree)
document.body.appendChild(rootNode)
// Main render loop
raf(function tick () {
var newTree = render()
var patches = diff(tree, newTree)
rootNode = patch(rootNode, patches)
tree = newTree
raf(tick)
})
var list = new ViewList(params)
params
can be (in addition to the virtual-dom
parameters):
tagName
: The tag to use. Default 'ul'
.
childTagName
: The tag to use for child elements. Default 'li'
.
className
: The classes to use on main element. Default 'view-list'
.
height
: The total height of the container. Default 500
.
rowHeight
: The height of each row. Default 30
.
eachrow
: A function that gets called for each row to return a custom element per row. Default:
function (row) {
return h(this.childTagName, {
style: {
height: this.rowHeight
}
}, [row])
}
(c) 2015 Kyle Robinson Young. MIT License
FAQs
An infinite scrolling list view element built on a virtual DOM.
We found that view-list demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
Application Security
New SEC disclosure rules aim to enforce timely cyber incident reporting, but fear of job loss and inadequate resources lead to significant underreporting.
Security News
The Python Software Foundation has secured a 5-year sponsorship from Fastly that supports PSF's activities and events, most notably the security and reliability of the Python Package Index (PyPI).