Skip to content

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

Merged
merged 3 commits into from
Jan 4, 2018

Conversation

lanzhiheng
Copy link
Contributor

No description provided.

src/helpers.js Outdated
@@ -1,3 +1,9 @@
/**
* Reduce the code which written in Vue.js for getting the state.
* @param {String} namepsace
Copy link
Member

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
Copy link
Member

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

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
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

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

namespace

@lanzhiheng lanzhiheng changed the title Add some js Doc for helper [WIP] Add some js Doc for helper Jan 3, 2018
@lanzhiheng
Copy link
Contributor Author

@ktsn Thank you for your comments, I will fix them and remove the WIP. 😄

@lanzhiheng lanzhiheng changed the title [WIP] Add some js Doc for helper Add some js Doc for helper Jan 4, 2018
@lanzhiheng
Copy link
Contributor Author

@ktsn Hi, I have fixed all PR by you feedback 😸

Copy link
Member

@ktsn ktsn left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@ktsn ktsn merged commit 75edfc5 into vuejs:dev Jan 4, 2018
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.

2 participants