MCPcopy Index your code
hub / github.com/UI5/webcomponents / process

Method process

packages/base/src/RenderQueue.ts:54–68  ·  view source on GitHub ↗

* Processes the whole queue by executing the callback on each component, * while also imposing restrictions on how many times a component may be processed. * * @param callback - function with one argument (the web component to be processed)

(callback: (el: UI5Element) => void)

Source from the content-addressed store, hash-verified

52 * @param callback - function with one argument (the web component to be processed)
53 */
54 process(callback: (el: UI5Element) => void) {
55 let webComponent;
56 const stats = new Map<UI5Element, number>();
57
58 webComponent = this.shift();
59 while (webComponent) {
60 const timesProcessed = stats.get(webComponent) || 0;
61 if (timesProcessed > MAX_PROCESS_COUNT) {
62 throw new Error(`Web component processed too many times this task, max allowed is: ${MAX_PROCESS_COUNT}`);
63 }
64 callback(webComponent);
65 stats.set(webComponent, timesProcessed + 1);
66 webComponent = this.shift();
67 }
68 }
69}
70
71export default RenderQueue;

Callers 4

hbs2litFunction · 0.80
scheduleRenderTaskFunction · 0.80

Calls 3

shiftMethod · 0.95
callbackFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected