MCPcopy
hub / github.com/facebook/react / enqueueFlush

Function enqueueFlush

packages/react-server/src/ReactFlightServer.js:6022–6040  ·  view source on GitHub ↗
(request: Request)

Source from the content-addressed store, hash-verified

6020}
6021
6022function enqueueFlush(request: Request): void {
6023 if (
6024 request.flushScheduled === false &&
6025 // If there are pinged tasks we are going to flush anyway after work completes
6026 request.pingedTasks.length === 0 &&
6027 // If there is no destination there is nothing we can flush to. A flush will
6028 // happen when we start flowing again
6029 (request.destination !== null ||
6030 (__DEV__ && request.debugDestination !== null))
6031 ) {
6032 request.flushScheduled = true;
6033 // Unlike startWork and pingTask we intetionally use scheduleWork
6034 // here even during prerenders to allow as much batching as possible
6035 scheduleWork(() => {
6036 request.flushScheduled = false;
6037 flushCompletedChunks(request);
6038 });
6039 }
6040}
6041
6042function callOnAllReadyIfReady(request: Request): void {
6043 if (request.abortableTasks.size === 0) {

Callers 11

serializeDebugThenableFunction · 0.70
serializeThenableFunction · 0.70
progressFunction · 0.70
errorFunction · 0.70
abortStreamFunction · 0.70
abortIterableFunction · 0.70
emitHintFunction · 0.70
abortBlobFunction · 0.70
resolveDebugMessageFunction · 0.70
closeDebugChannelFunction · 0.70

Calls 2

scheduleWorkFunction · 0.90
flushCompletedChunksFunction · 0.85

Tested by

no test coverage detected