mithril
Version:
A framework for building brilliant applications
28 lines (22 loc) • 530 B
JavaScript
var delayedRemoval = new WeakMap
function *domFor(vnode, object = {}) {
// To avoid unintended mangling of the internal bundler,
// parameter destructuring is not used here.
var dom = vnode.dom
var domSize = vnode.domSize
var generation = object.generation
if (dom != null) do {
var nextSibling = dom.nextSibling
if (delayedRemoval.get(dom) === generation) {
yield dom
domSize--
}
dom = nextSibling
}
while (domSize)
}
module.exports = {
delayedRemoval: delayedRemoval,
domFor: domFor,
}