forked from enviPath/enviPy
Current Dev State
This commit is contained in:
21
static/js/ketcher2/node_modules/preact/src/render-queue.js
generated
vendored
Normal file
21
static/js/ketcher2/node_modules/preact/src/render-queue.js
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
import options from './options';
|
||||
import { renderComponent } from './vdom/component';
|
||||
|
||||
/** Managed queue of dirty components to be re-rendered */
|
||||
|
||||
let items = [];
|
||||
|
||||
export function enqueueRender(component) {
|
||||
if (!component._dirty && (component._dirty = true) && items.push(component)==1) {
|
||||
(options.debounceRendering || setTimeout)(rerender);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export function rerender() {
|
||||
let p, list = items;
|
||||
items = [];
|
||||
while ( (p = list.pop()) ) {
|
||||
if (p._dirty) renderComponent(p);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user