-
Notifications
You must be signed in to change notification settings - Fork 830
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JSDoc refresh for the sw-routing module #153
Conversation
|
||
**Parameters** | ||
|
||
- `path` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** The path to use for routing. | ||
- `handler` **[function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** The handler to manage the response. | ||
If the path contains [named parameters](https://github.com/pillarjs/path-to-regexp#named-parameters), | ||
then an Object mapping parameter names to the corresponding value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then an Object mapping parameter names
Names what? I don't understand this sentence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"parameter names" is a compound noun, but I could see how it might be interpreted with "names" as a verb.
Would it be clearer rephrased as "the names of parameters"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
- `handler` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** An Object with a `handle` method. That method | ||
will be used to respond to matching requests. | ||
- `method` **\[[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** Only match requests that use this | ||
HTTP method. Defaults to `'GET'` if not specified. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just checking. Are the quotes intended to be part of this literal string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you change it, do it throughout. I found it at least one other place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it was intentional, but if as a matter of style you'd prefer 'GET', I'm fine with that too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The point of quotation marks is to set the thing off visually, believe it or not. We get that by virtue of the monospaced font. If it's not part of the literal, take it out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The single quotes are there to indicate that 'GET' is a string literal. They aren't optional here.
The backticks are a matter of style when it's already obvious that it's a string literal. I tend to be super-over-backtick-zealous, so feel free to edit those out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's fine.
R: @addyosmani @gauntface @jpmedley
Fixes #150
Refresh of the
sw-routing
JSDocs. It errs on the wordy side right now...