-
Notifications
You must be signed in to change notification settings - Fork 110
docs: Add parameters to remaining commit overloads
#1441
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
base: main
Are you sure you want to change the base?
Conversation
b365601 to
50cce00
Compare
danieljbruce
left a comment
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.
Overall it's a vast improvement over what was already there. Great job!
There are just a few nits that are worth looking at and then this should likely be good to merge. After this PR, we will want to make all code changes are made in the new monorepo at https://github.com/googleapis/google-cloud-node as this repository is currently being deprecated.
| * // If the callback is omitted, we'll return a Promise. | ||
| * //- | ||
| * transaction.commit().then((data) => { | ||
| * const apiResponse = data[0]; |
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.
First and foremost, I think it is worth it for me to post a link here at https://docs.cloud.google.com/nodejs/docs/reference/datastore/latest/datastore/transaction#_google_cloud_datastore_Transaction_commit_member_1_ to the documentation that is going to change. That way when we update the docs we can easily check what changes were made.
| /** | ||
| * @param {CallOptions} [gaxOptions] Request configuration options. | ||
| * See {@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions CallOptions Docs}. | ||
| * @param {CommitCallback} callback The callback function. |
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.
nit: callback should probably be [callback].
| * @param {object} [gaxOptions] Request configuration options, outlined here: | ||
| * https://googleapis.github.io/gax-nodejs/global.html#CallOptions. | ||
| * @param {object} [gaxOptions] Request configuration options. | ||
| * See {@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions CallOptions Docs}. |
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.
I think the * @param {object} [gaxOptions] parameter can be eliminated entirely because its not in the following commit(callback: CommitCallback) signature?
| * https://googleapis.github.io/gax-nodejs/global.html#CallOptions. | ||
| * @param {object} [gaxOptions] Request configuration options. | ||
| * See {@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions CallOptions Docs}. | ||
| * @param {function} callback The callback function. |
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.
I think this function can be replaced with the more specific CommitCallback type.
| /** | ||
| * @param {CallOptions} [gaxOptionsOrCallback] Request configuration options. | ||
| * See {@link https://googleapis.github.io/gax-nodejs/global.html#CallOptions CallOptions Docs}. | ||
| * @param cb The callback function. |
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.
nit: We should probably add {CommitCallback} here so that the parameter has a type. Also we should wrap cb in square brackets. ie. [cb].
Description
This PR is part of a larger effort to update our documentation for method parameters to contain a type link for that type.
Impact
This will update our documentation and add more lines of description for our users.
Checklist