Skip to content

Commit

Permalink
Rename Controls to PipeableStream (#24286)
Browse files Browse the repository at this point in the history
This type isn't exported so it's technically not public.

This object mimics a ReadableStream.

Currently this is safe to destructure and call separately but I'm not sure
that's even guaranteed. It should probably be treated as a class in docs.
  • Loading branch information
sebmarkbage authored Apr 6, 2022
1 parent ece5295 commit 4bc465a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/react-dom/src/server/ReactDOMFizzServerNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type Options = {|
onError?: (error: mixed) => void,
|};

type Controls = {|
type PipeableStream = {|
// Cancel any pending I/O and put anything remaining into
// client rendered mode.
abort(): void,
Expand Down Expand Up @@ -76,7 +76,7 @@ function createRequestImpl(children: ReactNodeList, options: void | Options) {
function renderToPipeableStream(
children: ReactNodeList,
options?: Options,
): Controls {
): PipeableStream {
const request = createRequestImpl(children, options);
let hasStartedFlowing = false;
startWork(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type Options = {
onError?: (error: mixed) => void,
};

type Controls = {|
type PipeableStream = {|
pipe<T: Writable>(destination: T): T,
|};

Expand All @@ -35,7 +35,7 @@ function renderToPipeableStream(
webpackMap: BundlerConfig,
options?: Options,
context?: Array<[string, ServerContextJSONValue]>,
): Controls {
): PipeableStream {
const request = createRequest(
model,
webpackMap,
Expand Down

0 comments on commit 4bc465a

Please sign in to comment.