-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Add some js Doc for helper #1100
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
Conversation
src/helpers.js
Outdated
@@ -1,3 +1,9 @@ | |||
/** | |||
* Reduce the code which written in Vue.js for getting the state. | |||
* @param {String} namepsace |
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.
Since namespace
is an optional parameter, it should be @param {String} [namespace]
. (same for other helpers)
http://usejsdoc.org/tags-param.html#optional-parameters-and-default-values
src/helpers.js
Outdated
@@ -1,3 +1,9 @@ | |||
/** | |||
* Reduce the code which written in Vue.js for getting the state. | |||
* @param {String} namepsace |
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.
...and there is a typo namepsace 😛
src/helpers.js
Outdated
function normalizeMap (map) { | ||
return Array.isArray(map) | ||
? map.map(key => ({ key, val: key })) | ||
: Object.keys(map).map(key => ({ key, val: map[key] })) | ||
} | ||
|
||
/** | ||
* Return a function expect two param contains namepsace and map. it will normalize the namespace and then the param's function will handle the new namespace and the map. |
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.
There is another typo (namepsace).
src/helpers.js
Outdated
@@ -22,10 +28,17 @@ export const mapState = normalizeNamespace((namespace, states) => { | |||
return res | |||
}) | |||
|
|||
/** | |||
* Reduce the code which written in Vue.js for committing the mutation | |||
* @param {String} namepsace |
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.
namespace
src/helpers.js
Outdated
* Search a special module from store by namespace. if module not exist, print error message. | ||
* @param {Object} store | ||
* @param {String} helper | ||
* @param {String} namepsace |
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.
namespace
@ktsn Thank you for your comments, I will fix them and remove the WIP. 😄 |
@ktsn Hi, I have fixed all PR by you feedback 😸 |
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.
LGTM, thanks!
No description provided.