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
Request: add a second argument to get for default value #10
Comments
Ok, I think I missed something. I forgot there is a configuration phase where you define the properties to be stored and I removed manually the key from Chrome developer tools and then it returned null. The default value is initialized when the component is created, if you delete the key while the app is running, you get the error. Same thing happens if you call |
Hi @cdarken. It's a great enhancement! I'll implement it ASAP |
Hi, @pinguinjkeke. You mean the reset in case it's removed? Because the default behavior works fine for settings default values at init, now that I remembered how to use it :) |
@cdarken default option writes to localStorage on initialization if it's empty. After remove it will be null. |
Feature is implemented in 0.2.0 version |
It would help to shave a few lines for testing if it's null or not and you have to initialize an array or an object so you can add values to it.
Example:
instead of
The text was updated successfully, but these errors were encountered: