MCPcopy Index your code
hub / github.com/react/react / unstable_flushUntilNextPaint

Function unstable_flushUntilNextPaint

packages/scheduler/src/forks/SchedulerMock.js:512–536  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

510}
511
512function unstable_flushUntilNextPaint(): false {
513 if (isFlushing) {
514 throw new Error('Already flushing work.');
515 }
516 if (scheduledCallback !== null) {
517 const cb = scheduledCallback;
518 shouldYieldForPaint = true;
519 needsPaint = false;
520 isFlushing = true;
521 try {
522 let hasMoreWork = true;
523 do {
524 hasMoreWork = cb(true, currentMockTime);
525 } while (hasMoreWork && !didStop);
526 if (!hasMoreWork) {
527 scheduledCallback = null;
528 }
529 } finally {
530 shouldYieldForPaint = false;
531 didStop = false;
532 isFlushing = false;
533 }
534 }
535 return false;
536}
537
538function unstable_hasPendingWork(): boolean {
539 return scheduledCallback !== null;

Callers

nothing calls this directly

Calls 1

cbFunction · 0.50

Tested by

no test coverage detected