Skip to content

Instantly share code, notes, and snippets.

@stubailo
Created December 16, 2016 07:57
Show Gist options
  • Select an option

  • Save stubailo/3c6b91ef8a75bb1e6a96e3f3838a22cc to your computer and use it in GitHub Desktop.

Select an option

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?
// 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