Skip to content

Commit 5d51eb2

Browse files
committed
update docusaurus
1 parent 9e337a0 commit 5d51eb2

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

website/src/pages/index.mdx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ If introduction of many optional properties truly can't be avoided utilize **dis
149149

150150
```ts
151151
// ❌ Avoid optional properties as they increase complexity
152-
type StatusParams = {
152+
type User = {
153153
id?: number;
154154
email?: string;
155155
dashboardAccess?: boolean;
@@ -184,6 +184,15 @@ type GuestUser = {
184184

185185
// Discriminated union type 'User' with no optional properties
186186
type User = AdminUser | RegularUser | GuestUser;
187+
188+
const regularUser: User = {
189+
role: 'regular',
190+
id: 212,
191+
192+
subscriptionPlan: 'pro',
193+
rewardsPoints: 1500,
194+
dashboardAccess: false, // Error 'dashboardAccess' property does not exist
195+
};
187196
```
188197

189198
### Discriminated union

0 commit comments

Comments
 (0)