MCPcopy Create free account
hub / github.com/QuarkGluonPlasma/react-course-code / workLoop

Function workLoop

mini-react/src/mini-react.js:44–58  ·  view source on GitHub ↗
(deadline)

Source from the content-addressed store, hash-verified

42 }
43
44 function workLoop(deadline) {
45 let shouldYield = false
46 while (nextUnitOfWork && !shouldYield) {
47 nextUnitOfWork = performUnitOfWork(
48 nextUnitOfWork
49 )
50 shouldYield = deadline.timeRemaining() < 1
51 }
52
53 if (!nextUnitOfWork && wipRoot) {
54 commitRoot()
55 }
56
57 requestIdleCallback(workLoop)
58 }
59
60 requestIdleCallback(workLoop)
61

Callers

nothing calls this directly

Calls 2

performUnitOfWorkFunction · 0.85
commitRootFunction · 0.85

Tested by

no test coverage detected