Skip to content

Commit b22e50b

Browse files
committed
Nit interop docs
1 parent 24df559 commit b22e50b

File tree

2 files changed

+20
-17
lines changed

2 files changed

+20
-17
lines changed

pages/docs/manual/latest/bind-to-js-function.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ ReScript has [labeled arguments](function.md#labeled-arguments) (that can also b
2626
// MyGame.js
2727

2828
function draw(x, y, border) {
29-
// suppose `border`` is optional and defaults to false
29+
// suppose `border` is optional and defaults to false
3030
}
3131
draw(10, 20)
3232
draw(20, 20, true)
@@ -259,7 +259,7 @@ external on: (
259259
let register = rl =>
260260
rl
261261
->on(#close(event => ()))
262-
->on(#line(line => print_endline(line)))
262+
->on(#line(line => Js.log(line)));
263263
```
264264
```js
265265
function register(rl) {
@@ -287,13 +287,13 @@ external processOnExit: (
287287
@bs.as("exit") _,
288288
int => unit
289289
) => unit = "process.on"
290-
let () = processOnExit(exit_code =>
291-
Js.log("error code: " ++ string_of_int(exit_code))
290+
let () = processOnExit(exitCode =>
291+
Js.log("error code: " ++ Js.Int.toString(exitCode))
292292
);
293293
```
294294
```js
295-
process.on("exit", function (exit_code) {
296-
console.log("error code: " + String(exit_code));
295+
process.on("exit", function (exitCode) {
296+
console.log("error code: " + exitCode.toString());
297297
});
298298
```
299299

@@ -308,9 +308,9 @@ Curry is a delicious Indian dish. More importantly, in the context of ReScript (
308308
See the `addFive` intermediate function? `add` takes in 3 arguments but received only 1. It's interpreted as "currying" the argument `5` and waiting for the next 2 arguments to be applied later on. Type signatures:
309309

310310
```resi
311-
let add: (int, int, int) => int;
312-
let addFive: (int, int) => int;
313-
let twelve: int;
311+
let add: (int, int, int) => int
312+
let addFive: (int, int) => int
313+
let twelve: int
314314
```
315315

316316
(In a dynamic language such as JS, currying would be dangerous, since accidentally forgetting to pass an argument doesn't error at compile time).

pages/docs/manual/latest/interop-cheatsheet.mdx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -196,16 +196,19 @@ var gpa = 2.1 + 10;
196196

197197
## List of `@bs` Decorators
198198

199-
- `@bs.val`
200-
- `@bs.scope`
199+
- `@bs.as`
201200
- `@bs.get`
202-
- `@bs.set`
201+
- `@bs.inline`
202+
- `@bs.int`
203+
- `@bs.meth`
204+
- `@bs.new`
205+
- `@bs.return`
206+
- `@bs.scope`
203207
- `@bs.send`
208+
- `@bs.set`
204209
- `@bs.string`
205-
- `@bs.int`
210+
- `@bs.this`
211+
- `@bs.uncurry`
206212
- `@bs.unwrap`
207-
- `@bs.new`
208-
- `@bs.as`
213+
- `@bs.val`
209214
- `@bs.variadic`
210-
- `@bs.inline`
211-
- `@bs.meth`

0 commit comments

Comments
 (0)