-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
Add JSDoc annotations to the public API #300
Conversation
* of the Redux store. This is handy for a variety of tasks, such as expressing | ||
* asynchronous actions in a concise manner, or logging every action payload. | ||
* | ||
* See `redux-thunk` package as an example of the Redux middleware. |
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.
You could use @link
here
http://usejsdoc.org/tags-inline-link.html
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.
Good point. For now I'd avoid hardcoding URL because we might move that package to a separate Github organization soon.
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.
That's probably wise
I'll get this in, but comments are still very much appreciated. The hardest part to understand is probably |
Add JSDoc annotations to the public API
* and some part of the state tree may potentially have changed. You may then | ||
* call `getState()` to read the current state tree inside the callback. | ||
* | ||
* @param {Function} listener A callback to be invoked on every dispatch. |
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.
A good way to document callbacks is to use the @callback
tag. This way you can document the @params
of 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.
Thanks, I didn't know this! Want to send a PR?
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.
Sure! I don't really have time tonight though. Guess I can do it after the merge?
Edit: Oh, its merged already ;)
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 feel free to make a PR against breaking-changes-1.0
branch.
This adds JSDoc annotations to the public API as discussed in #140 and #89.
Comments are welcome!
(This is written against the 1.0 API which is not officially released yet.)