Replies: 1 comment 5 replies
-
Thanks, Dan. I think the first is most readable since the types are within the function definition.I realize that differs from your point of view. Having to scroll means keeping the context in my head rather than seeing it in one place. Do we have examples of re-using these types of object argument types in multiple places?I can't think of any off the top of my head and that would help me understand the value of separating it. Is there a strong use case for
|
Beta Was this translation helpful? Give feedback.
-
Let's come up with a guideline around how to write type annotations in our function signatures. Here are a few examples of how it could be done:
What do we want to make our standard? There was some discussion recently that if we define our type separately from the function signature, we could export the type itself from the file, to make available to other files. I also think that declaring an interface or a type alias separately from the function signature can improve readability as well.
Beta Was this translation helpful? Give feedback.
All reactions