Skip to content

Instantly share code, notes, and snippets.

@pomber
Created October 13, 2017 21:18
Show Gist options
  • Save pomber/0bc1c3c47dc1d4e79145d1e61bdfb25f to your computer and use it in GitHub Desktop.
Save pomber/0bc1c3c47dc1d4e79145d1e61bdfb25f to your computer and use it in GitHub Desktop.
function performUnitOfWork(wipFiber) {
beginWork(wipFiber);
if (wipFiber.child) {
return wipFiber.child;
}
// No child, we call completeWork until we find a sibling
let uow = wipFiber;
while (uow) {
completeWork(uow);
if (uow.sibling) {
// Sibling needs to beginWork
return uow.sibling;
}
uow = uow.parent;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment