Skip to content

Commit ca5bafd

Browse files
committed
Document the @deprecated attribute. Fixes #168
1 parent 10dff18 commit ca5bafd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pages/docs/manual/latest/attribute.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ type student = {
4545
age: int,
4646
@bs.as("aria-label") ariaLabel: string,
4747
}
48+
49+
@deprecated
50+
let customDouble = foo => foo * 2
51+
52+
@deprecated("Do the math yourself!")
53+
let customTriple = foo => foo * 3
4854
```
4955
```js
5056
```
@@ -55,6 +61,8 @@ type student = {
5561
2. `@unboxed` annotates the type definition.
5662
3. `@bs.val` annotates the `external` statement.
5763
4. `@bs.as("aria-label")` annotates the `ariaLabel` record field.
64+
5. `@deprecated` annotates the `customDouble` expression. This shows a warning while compiling telling consumers to not rely on this method long-term.
65+
6. `@deprecated("Outdated")` annotates the `customTriple` expression with a string to describe the reason for deprecation.
5866

5967
## Extension Point
6068

0 commit comments

Comments
 (0)