()
| 221 | }); |
| 222 | |
| 223 | function onShellReady() { |
| 224 | let writable: Writable; |
| 225 | const stream: ReactDOMServerReadableStream = (new ReadableStream( |
| 226 | { |
| 227 | type: 'bytes', |
| 228 | start: (controller): ?Promise<void> => { |
| 229 | writable = |
| 230 | createFakeWritableFromReadableStreamController(controller); |
| 231 | }, |
| 232 | pull: (controller): ?Promise<void> => { |
| 233 | startFlowing(request, writable); |
| 234 | }, |
| 235 | cancel: (reason): ?Promise<void> => { |
| 236 | stopFlowing(request); |
| 237 | abort(request, reason); |
| 238 | }, |
| 239 | }, |
| 240 | // $FlowFixMe[prop-missing] size() methods are not allowed on byte streams. |
| 241 | {highWaterMark: 0}, |
| 242 | ): any); |
| 243 | // TODO: Move to sub-classing ReadableStream. |
| 244 | stream.allReady = allReady; |
| 245 | resolve(stream); |
| 246 | } |
| 247 | function onShellError(error: mixed) { |
| 248 | // If the shell errors the caller of `renderToReadableStream` won't have access to `allReady`. |
| 249 | // However, `allReady` will be rejected by `onFatalError` as well. |
nothing calls this directly
no test coverage detected