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

Function onAllReady

packages/react-dom/src/server/ReactDOMFizzStaticBrowser.js:81–107  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

79 const onFatalError = reject;
80
81 function onAllReady() {
82 const stream = new ReadableStream(
83 {
84 type: 'bytes',
85 pull: (controller): ?Promise<void> => {
86 startFlowing(request, controller);
87 },
88 cancel: (reason): ?Promise<void> => {
89 stopFlowing(request);
90 abort(request, reason);
91 },
92 },
93 // $FlowFixMe[prop-missing] size() methods are not allowed on byte streams.
94 {highWaterMark: 0},
95 );
96
97 const result: StaticResult =
98 enablePostpone || enableHalt
99 ? {
100 postponed: getPostponedState(request),
101 prelude: stream,
102 }
103 : ({
104 prelude: stream,
105 }: any);
106 resolve(result);
107 }
108
109 const onHeaders = options ? options.onHeaders : undefined;
110 let onHeadersImpl;

Callers

nothing calls this directly

Calls 5

startFlowingFunction · 0.90
stopFlowingFunction · 0.90
abortFunction · 0.90
getPostponedStateFunction · 0.90
resolveFunction · 0.50

Tested by

no test coverage detected