Skip to content

Commit

Permalink
fix: type of pipeable stream to allow objects with keys
Browse files Browse the repository at this point in the history
  • Loading branch information
anmonteiro committed Sep 5, 2024
1 parent fa71fa8 commit 53d60fe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/ReactDOMServerNode.re
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@ type options = {
progressiveChunkSize: option(int),
};

type pipeableStream = {
type pipeableStream('a) = {
/* Using empty object instead of Node.stream since Melange don't provide a binding to node's Stream (https://nodejs.org/api/stream.html) */
pipe: Js.t({.}) => unit,
pipe: Js.t({..} as 'a) => unit,
abort: unit => unit,
};

[@mel.module "react-dom/server"]
external renderToPipeableStream: (React.element, options) => pipeableStream =
external renderToPipeableStream:
(React.element, options) => pipeableStream('a) =
"renderToPipeableStream";

let renderToPipeableStream =
Expand Down
6 changes: 3 additions & 3 deletions src/ReactDOMServerNode.rei
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ type options = {
progressiveChunkSize: option(int),
};

type pipeableStream = {
type pipeableStream('a) = {
/* Using empty object instead of Node.stream since Melange don't provide a binding to node's Stream (https://nodejs.org/api/stream.html) */
pipe: Js.t({.}) => unit,
pipe: Js.t({..} as 'a) => unit,
abort: unit => unit,
};

Expand All @@ -45,4 +45,4 @@ let renderToPipeableStream:
~progressiveChunkSize: int=?,
React.element
) =>
pipeableStream;
pipeableStream('a);

0 comments on commit 53d60fe

Please sign in to comment.