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
Convenience methods #155
Convenience methods #155
Conversation
I appreciate the pull request, but it generally needs a bit more work. Try to look over your own diff before submitting a pull request to catch a lot of obvious stuff ;) |
Apply some of the typo suggestions Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
Thanks for taking a look at this. Since I am using this module a lot, I wanned to give something back |
|
||
#### .mutate(key, mutation) | ||
|
||
Calls supplied mutation on the item and replaces it with its result. |
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.
This sentence needs more work and I think it could be useful with an example showing how to use it.
|
||
Append value into the array | ||
|
||
Type of the item must be `array`. Trying to append into different type will result in TypeError. |
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.
This is missing from the TS 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.
What do you mean by "this"?
Append value into the array. | ||
|
||
@param {key} - You can use [dot-notation](https://github.com/sindresorhus/dot-prop) in a key to access nested properties. | ||
@param value - Must be JSON serializable. Trying to set the type `undefined`, `function`, or `symbol` will result in a `TypeError`. |
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.
This is missing from the readme.
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.
Explain
|
||
if (this._containsReservedKey(key)) { | ||
throw new TypeError(`Please don't use the ${INTERNAL_KEY} key, as it's used to manage this module internal operations.`); | ||
} |
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.
This is used multiple times now and should be abstracted into a function.
Toggle a boolean item. | ||
|
||
@param key - The key of the item to toggle. | ||
@returns the new value after successful toggle |
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.
Should be properly formatted.
The docs generally still needs more work. There are missing things and inconsistencies. |
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
Bump |
Well, your comments are mostly vague and carry no clear information about what is wrong or needs to be done... I'd appreciate some more help with this. EDIT: After some time, this has become more hassle than it's worth doing anything for this module |
Hopefully leads to resolving sindresorhus/electron-store#52