Sha256: 0214461644d906b3f1212726a470e3efb279ddb941e801f7491a80549c1ed16f
Contents?: true
Size: 710 Bytes
Versions: 85
Compression:
Stored size: 710 Bytes
Contents
import options from './options'; import { defer } from './util'; import { renderComponent } from './vdom/component'; /** * Managed queue of dirty components to be re-rendered * @type {Array<import('./component').Component>} */ let items = []; /** * Enqueue a rerender of a component * @param {import('./component').Component} component The component to rerender */ export function enqueueRender(component) { if (!component._dirty && (component._dirty = true) && items.push(component)==1) { (options.debounceRendering || defer)(rerender); } } /** Rerender all enqueued dirty components */ export function rerender() { let p; while ( (p = items.pop()) ) { if (p._dirty) renderComponent(p); } }
Version data entries
85 entries across 85 versions & 1 rubygems