You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/src/pages/index.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -396,15 +396,15 @@ transformUserInput({
396
396
When applicable use **discriminated union type** to eliminate optional args, which will decrease complexity on function API and only necessary/required args will be passed depending on its use case.
397
397
398
398
```ts
399
-
// ❌ Avoid optional args as they increase complexity of function API
399
+
// ❌ Avoid optional properties as they increase complexity of function API
400
400
typeStatusParams= {
401
401
data?: Products;
402
402
title?:string;
403
403
time?:number;
404
404
error?:string;
405
405
};
406
406
407
-
// ✅ Strive to have majority of args required, if that's not possible,
407
+
// ✅ Strive to have majority of properties required, if that's not possible,
408
408
// use discriminated union for clear intent on function usage
0 commit comments