()
| 91 | }); |
| 92 | |
| 93 | function onShellReady() { |
| 94 | const stream: ReactDOMServerReadableStream = (new ReadableStream( |
| 95 | { |
| 96 | type: 'bytes', |
| 97 | pull: (controller): ?Promise<void> => { |
| 98 | startFlowing(request, controller); |
| 99 | }, |
| 100 | cancel: (reason): ?Promise<void> => { |
| 101 | stopFlowing(request); |
| 102 | abort(request, reason); |
| 103 | }, |
| 104 | }, |
| 105 | // $FlowFixMe[prop-missing] size() methods are not allowed on byte streams. |
| 106 | {highWaterMark: 0}, |
| 107 | ): any); |
| 108 | // TODO: Move to sub-classing ReadableStream. |
| 109 | stream.allReady = allReady; |
| 110 | resolve(stream); |
| 111 | } |
| 112 | function onShellError(error: mixed) { |
| 113 | // If the shell errors the caller of `renderToReadableStream` won't have access to `allReady`. |
| 114 | // However, `allReady` will be rejected by `onFatalError` as well. |
nothing calls this directly
no test coverage detected