Created
December 16, 2016 07:57
-
-
Save stubailo/3c6b91ef8a75bb1e6a96e3f3838a22cc to your computer and use it in GitHub Desktop.
Why do all code docs tools put the doc in a separate comment instead of in the code?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Quick idea. I love doc comments, but it's annoying that you need to repeat all of the | |
| // argument names again, just to document them. It's easy for parameter lists to fall out | |
| // of date. Plus, if you're using a typed language a lot of the information is already | |
| // there. Is there a tool to parse comments like the below? | |
| /** Create a Redux store. Using this function as a convenient example. */ | |
| function createStore( | |
| /** A reducer function that maps the previous state and current action to the next state. */ | |
| reducer: ReducerFunction, | |
| /** Initial state that might come from a previous session or a server-side render. */ | |
| preloadedState?: any, | |
| /** A function to act as a store enhancer. Use `compose` if you need multiple enhancers. */ | |
| enhancers?: [EnhancerFunction] | |
| ) { | |
| // TODO: implement | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment