function ensureCleanSlate(vnode) {
    if (!vnode[markerCleanSlate]) {
        vnode[markerCleanSlate] = true;
        vnode.dispatch((targetNode) => {
            const childNodes = Array.prototype.slice.call(targetNode.childNodes);
            childNodes.forEach(c => c.remove());
            const _restore = vnode.restore;
            vnode.restore = () => {
                childNodes.forEach(c => targetNode.appendChild(c));
                _restore && _restore();
            };
        });
    }
}
/**
 * Makes sure that target node is clear of any previous children, and that
 * they will be restored when vnode is detached.
 * @param {import('./vnode').VNode} vnode 
 */
Makes sure that target node is clear of any previous children, and that
they will be restored when vnode is detached.
Makes sure that target node is clear of any previous children and that they will be restored when vnode is detached .
function ensureCleanSlate(vnode) {
    if (!vnode[markerCleanSlate]) {
        vnode[markerCleanSlate] = true;
        vnode.dispatch((targetNode) => {
            const childNodes = Array.prototype.slice.call(targetNode.childNodes);
            childNodes.forEach(c => c.remove());
            const _restore = vnode.restore;
            vnode.restore = () => {
                childNodes.forEach(c => targetNode.appendChild(c));
                _restore && _restore();
            };
        });
    }
}
function ensureCleanSlate ( vnode ) { if ( ! vnode [ markerCleanSlate ] ) { vnode [ markerCleanSlate ] = true ; vnode . dispatch ( ( targetNode ) => { const childNodes = Array . prototype . slice . call ( targetNode . childNodes ) ; childNodes . forEach ( c => c . remove ( ) ) ; const _restore = vnode . restore ; vnode . restore = ( ) => { childNodes . forEach ( c => targetNode . appendChild ( c ) ) ; _restore && _restore ( ) ; } ; } ) ; } }
Makes sure that target node is clear of any previous children, and that
 they will be restored when vnode is detached.
Makes sure that target node is clear of any previous children and that they will be restored when vnode is detached .