Skip to content

Commit

Permalink
update docusaurus
Browse files Browse the repository at this point in the history
  • Loading branch information
mkosir committed Mar 8, 2024
1 parent 7654bcf commit 0ab0f56
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions website/src/pages/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ Discriminated unions are a powerful concept you may encounter in various program

Embrace using discriminated unions, since code becomes easier to read and understand by explicitly indicating the possible cases for a given type.

- As mentioned in [Args as Discriminated Union](#args-as-discriminated-union), discriminated union eliminates optional args which decreases complexity on function API.
- Exhaustiveness check - TypeScript can ensure that all possible variants of a type are implemented, eliminating the risk of undefined or unexpected behavior at runtime. ([eslint rule](https://typescript-eslint.io/rules/switch-exhaustiveness-check/))

```ts
Expand Down

0 comments on commit 0ab0f56

Please sign in to comment.