Skip to content

Commit 9efd4c7

Browse files
committed
upgraded compiler to 'bs-platform@^8.3.0'; fixed some example code;
1 parent 7a470a5 commit 9efd4c7

File tree

3 files changed

+35
-344
lines changed

3 files changed

+35
-344
lines changed

examples/StreamTextToFile.re

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
2-
let data = "Sample text to write to a file!" -> Buffer.fromString;
1+
let data = "Sample text to write to a file!"->Buffer.fromString;
32
let process = Process.process;
43

5-
let outputPath = Path.relative(
6-
~from= Process.cwd(process),
7-
~to_="example__output.txt"
8-
);
4+
let outputPath =
5+
Path.relative(~from=Process.cwd(process), ~to_="example__output.txt");
96

107
let writeStream = Fs.createWriteStream(outputPath);
118

12-
let logErrorIfExists = (maybeError) => {
13-
switch (Js.Nullable.toOption(maybeError)) {
14-
| Some(err) => Js.log2("An error occurred", err);
15-
| None => ();
16-
};
17-
}
18-
19-
writeStream -> Stream.writeWith(
20-
data,
21-
~callback=(maybeError) => {
22-
logErrorIfExists(maybeError);
23-
Js.log("Finished");
24-
},
25-
()
26-
);
9+
let logErrorIfExists = maybeError => {
10+
switch (Js.Nullable.toOption(maybeError)) {
11+
| Some(err) => Js.log2("An error occurred", err)
12+
| None => ()
13+
};
14+
};
2715

16+
let () =
17+
writeStream
18+
->Stream.writeWith(
19+
data,
20+
~callback=
21+
maybeError => {
22+
logErrorIfExists(maybeError);
23+
Js.log("Finished");
24+
},
25+
(),
26+
)
27+
->ignore;

package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,8 @@
1717
"homepage": "https://github.com/sikanhe/reason-node",
1818
"license": "MIT",
1919
"dependencies": {},
20-
"peerDependencies": {
21-
"bs-platform": ">= 7.3.2"
22-
},
2320
"devDependencies": {
2421
"@glennsl/bs-jest": "^0.4.10",
25-
"bs-platform": "7.3.2"
22+
"bs-platform": "^8.3.0"
2623
}
2724
}

0 commit comments

Comments
 (0)