Skip to content

Commit 9be40cf

Browse files
author
Kevan Stannard
committed
Update variadic decorator
1 parent 1d02953 commit 9be40cf

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

misc_docs/syntax/decorator_variadic.mdx

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ category: "decorators"
88

99
The `@variadic` decorator is used to model JavaScript functions that take a variable number of arguments, where all arguments are of the same type.
1010

11-
For example:
11+
### Example
1212

1313
<CodeTab labels={["ReScript", "JS Output"]}>
1414

@@ -25,21 +25,6 @@ var result = Math.max(5, -2, 6, 1);
2525

2626
</CodeTab>
2727

28-
If your function has mandatory arguments, you can use the `@as` decorator to add them:
28+
### References
2929

30-
<CodeTab labels={["ReScript", "JS Output"]}>
31-
32-
```res
33-
@val @variadic
34-
external warn: (@as(404) _, @as("NOT_FOUND") _, array<string>) => unit = "log"
35-
36-
warn([])
37-
warn(["this", "page", "is", "not", "found"])
38-
```
39-
40-
```js
41-
log(404, "NOT_FOUND");
42-
log(404, "NOT_FOUND", "this", "page", "is", "not", "found");
43-
```
44-
45-
</CodeTab>
30+
* [Variadic Function Arguments](/docs/manual/latest/bind-to-js-function#variadic-function-arguments)

0 commit comments

Comments
 (0)