Skip to content

Commit 7c2d8a4

Browse files
committed
update docusaurus
1 parent 4f3f032 commit 7c2d8a4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

website/src/pages/index.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -607,12 +607,12 @@ export const parseStatus = (params: StatusParams) => {...
607607
608608
Consider the advantages of explicitly defining the return type of a function::
609609
610-
- Return values makes it clear and easy to understand to any calling code what type is returned.
611-
- In the case where there is no return value, the calling code doesn't try to use the undefined value when it shouldn't.
612-
- Surface potential type errors faster in the future if there are code changes that change the return type of the function.
613-
- Easier to refactor, since it ensures that the return value is assigned to a variable of the correct type.
614-
- Similar to writing tests before implementation (TDD), defining function arguments and return type, gives you the opportunity to discuss the feature functionality and its interface ahead of implementation.
615-
- Although type inference is very convenient, adding return types can save TypeScript compiler a lot of work.
610+
- Improves Readability: Clearly specifies what type of value the function returns, making the code easier to understand for those calling the function.
611+
- Avoids Misuse: Ensures that calling code does not accidentally attempt to use an undefined value when no return value is intended.
612+
- Surfaces Type Errors Early: Helps catch potential type errors during development, especially when code changes unintentionally alter the return type.
613+
- Simplifies Refactoring: Ensures that any variable assigned to the function's return value is of the correct type, making refactoring safer and more efficient.
614+
- Encourages Design Discussions: Similar to Test-Driven Development (TDD), explicitly defining function arguments and return types promotes discussions about a function's functionality and interface ahead of implementation.
615+
- Optimizes Compilation: While TypeScript's type inference is powerful, explicitly defining return types can reduce the workload on the TypeScript compiler, improving overall performance.
616616
617617
## Variables
618618

0 commit comments

Comments
 (0)