MCPcopy Index your code
hub / github.com/preactjs/preact / commitRoot

Function commitRoot

src/diff/index.js:360–380  ·  view source on GitHub ↗
(commitQueue, root, refQueue)

Source from the content-addressed store, hash-verified

358 * @param {VNode} root
359 */
360export function commitRoot(commitQueue, root, refQueue) {
361 for (let i = 0; i < refQueue.length; i++) {
362 applyRef(refQueue[i], refQueue[++i], refQueue[++i]);
363 }
364
365 if (options._commit) options._commit(root, commitQueue);
366
367 commitQueue.some(c => {
368 try {
369 // @ts-expect-error Reuse the commitQueue variable here so the type changes
370 commitQueue = c._renderCallbacks;
371 c._renderCallbacks = [];
372 commitQueue.some(cb => {
373 // @ts-expect-error See above comment on commitQueue
374 cb.call(c);
375 });
376 } catch (e) {
377 options._catchError(e, c._vnode);
378 }
379 });
380}
381
382function cloneNode(node) {
383 if (typeof node != 'object' || node == NULL || node._depth > 0) {

Callers 2

renderComponentFunction · 0.90
renderFunction · 0.90

Calls 3

_catchErrorMethod · 0.80
applyRefFunction · 0.70
_commitMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…