Skip to content
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

parseValue error in app-localstorage-document #79

Open
quangld opened this issue Dec 9, 2016 · 1 comment
Open

parseValue error in app-localstorage-document #79

quangld opened this issue Dec 9, 2016 · 1 comment

Comments

@quangld
Copy link

quangld commented Dec 9, 2016

I am not really sure this is an issue or it should be handled differently.
It happened for me when the this.storage.getItem(this.key) returns a string of 'undefined'

error in app-localstorage-document

And this problem is caused by setStorageValue of an undefined variable.
I wonder it would be better to check if this.data is undefined before using JSON.stringify and save it

      __setStorageValue: function(key, value) {
        this.storage.setItem(this.key, JSON.stringify(this.data));
      }

and why there is a "value" parameter in the above __setStorageValue method?

@bennypowers
Copy link

is _setStorageValue supposed to be:

      __setStorageValue: function(key, value) {
        this.storage.setItem(this.key, JSON.stringify(value));
      }

?

bennypowers added a commit to bennypowers/app-storage that referenced this issue Jul 11, 2017
in many cases, users will want to destroy a bound value by setting it as undefined

solves PolymerElements#79
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

No branches or pull requests

2 participants