Skip to content

Commit 5141b49

Browse files
author
Kevan Stannard
committed
Clean up, standardise, simplify
1 parent 9be40cf commit 5141b49

16 files changed

+27
-71
lines changed

misc_docs/syntax/decorator_as.mdx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
id: "as-decorator"
3-
keywords: ["as", "decorator", "record", "field", "alias", "object"]
3+
keywords: ["as", "decorator"]
44
name: "@as"
55
summary: "This is the `@as` decorator."
66
category: "decorators"
@@ -34,9 +34,3 @@ var action = {
3434

3535
* [Constrain Arguments Better](/docs/manual/latest/bind-to-js-function#constrain-arguments-better)
3636
* [Fixed Arguments](/docs/manual/latest/bind-to-js-function#fixed-arguments)
37-
38-
### Related
39-
40-
* `@int`
41-
* `@string`
42-
* `@variadic`

misc_docs/syntax/decorator_deriving.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
id: "deriving-decorator"
3-
keywords: ["deriving", "decorator", "record"]
3+
keywords: ["deriving", "decorator"]
44
name: "@deriving"
55
summary: "This is the `@deriving` decorator."
66
category: "decorators"

misc_docs/syntax/decorator_get.mdx

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
id: "get-decorator"
3-
keywords: ["get", "decorator", "property", "object", "bind"]
3+
keywords: ["get", "decorator"]
44
name: "@get"
55
summary: "This is the `@get` decorator."
66
category: "decorators"
@@ -13,31 +13,19 @@ The `@get` decorator is used to bind to a property of an object.
1313
<CodeTab labels={["ReScript", "JS Output"]}>
1414

1515
```res
16-
type element
16+
type window
17+
@bs.val external window: window = "window"
18+
@bs.get external getName: window => string = "name"
1719
18-
@scope("document") @val
19-
external createElement: string => element = "createElement"
20-
21-
@get
22-
external getScrollTop: element => unit = "scrollTop"
23-
24-
let div = createElement("div")
25-
let top = getScrollTop(div)
20+
let name = getName(window)
2621
```
2722

2823
```js
29-
var div = document.createElement("div")
30-
var top = div.scrollTop
24+
var name = window.name;
3125
```
3226

3327
</CodeTab>
3428

3529
### References
3630

3731
- [Bind using Special `@bs` Getters & Setters](/docs/manual/latest/bind-to-js-object#bind-using-special-bs-getters--setters)
38-
39-
### Related
40-
41-
- `@set`
42-
- `@get_index`
43-
- `@set_index`

misc_docs/syntax/decorator_get_index.mdx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
id: "get-index-decorator"
3-
keywords: ["get", "decorator", "array", "object", "index"]
3+
keywords: ["get", "index", "decorator"]
44
name: "@get_index"
55
summary: "This is the `@get_index` decorator."
66
category: "decorators"
@@ -43,9 +43,3 @@ var value = o["y"];
4343
### References
4444

4545
- [Bind using Special `@bs` Getters & Setters](/docs/manual/latest/bind-to-js-object#bind-using-special-bs-getters--setters)
46-
47-
### Related
48-
49-
- `@get`
50-
- `@set`
51-
- `@set_index`

misc_docs/syntax/decorator_inline.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
id: "inline-decorator"
3-
keywords: ["inline", "decorator", "constant"]
3+
keywords: ["inline", "decorator"]
44
name: "@inline"
55
summary: "This is the `@inline` decorator."
66
category: "decorators"

misc_docs/syntax/decorator_int.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
id: "int-decorator"
3-
keywords: ["int", "decorator", "polymorphic", "variant", "as", "external"]
3+
keywords: ["int", "decorator"]
44
name: "@int"
55
summary: "This is the `@int` decorator."
66
category: "decorators"

misc_docs/syntax/decorator_meth.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
id: "meth-decorator"
3-
keywords: ["meth", "decorator", "object", "function"]
3+
keywords: ["meth", "decorator"]
44
name: "@meth"
55
summary: "This is the `@meth` decorator."
66
category: "decorators"

misc_docs/syntax/decorator_module.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
id: "module-decorator"
3-
keywords: ["module", "decorator", "import", "require", "bind"]
3+
keywords: ["module", "decorator"]
44
name: "@module"
55
summary: "This is the `@module` decorator."
66
category: "decorators"

misc_docs/syntax/decorator_new.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
id: "new-decorator"
3-
keywords: ["new", "decorator", "object"]
3+
keywords: ["new", "decorator"]
44
name: "@new"
55
summary: "This is the `@new` decorator."
66
category: "decorators"

misc_docs/syntax/decorator_return.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
---
22
id: "return-decorator"
3-
keywords: ["return", "decorator", "null", "undefined"]
3+
keywords: ["return", "decorator"]
44
name: "@return"
55
summary: "This is the `@return` decorator."
66
category: "decorators"
77
---
88

99
The `@return` decorator is used to control how `null` and `undefined` values are converted to `option` types in ReScript.
1010

11-
1211
### Example
1312

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

0 commit comments

Comments
 (0)