Skip to content

Commit 7b68caf

Browse files
authored
Merge pull request #171 from bdunn313/feature/document-depreciated-decorator
Document the @deprecated attribute. Fixes #168
2 parents 0eb40d1 + b6210c0 commit 7b68caf

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("Use SomeOther.customTriple instead")
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("Use SomeOther.customTriple instead")` annotates the `customTriple` expression with a string to describe the reason for deprecation.
5866

5967
## Extension Point
6068

0 commit comments

Comments
 (0)