()
| 75 | }); |
| 76 | |
| 77 | function onShellReady() { |
| 78 | const stream: ReactDOMServerReadableStream = (new ReadableStream( |
| 79 | { |
| 80 | type: 'direct', |
| 81 | pull: (controller): ?Promise<void> => { |
| 82 | // $FlowIgnore |
| 83 | startFlowing(request, controller); |
| 84 | }, |
| 85 | cancel: (reason): ?Promise<void> => { |
| 86 | stopFlowing(request); |
| 87 | abort(request, reason); |
| 88 | }, |
| 89 | }, |
| 90 | // $FlowFixMe[prop-missing] size() methods are not allowed on byte streams. |
| 91 | {highWaterMark: 2048}, |
| 92 | ): any); |
| 93 | // TODO: Move to sub-classing ReadableStream. |
| 94 | stream.allReady = allReady; |
| 95 | resolve(stream); |
| 96 | } |
| 97 | function onShellError(error: mixed) { |
| 98 | // If the shell errors the caller of `renderToReadableStream` won't have access to `allReady`. |
| 99 | // However, `allReady` will be rejected by `onFatalError` as well. |
no test coverage detected