Skip to content
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

Merged
merged 6 commits into from
Jan 14, 2017
Merged

Conversation

jeffposnick
Copy link
Contributor

R: @addyosmani @gauntface @jpmedley

Fixes #150

Refresh of the sw-routing JSDocs. It errs on the wordy side right now...


**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
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor

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.
Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants