The initialization has changed. If you'd like to initialize value to a default when empty, use 'iron-localstorage-load-empty' event handler.
Aleks On Tuesday, July 28, 2015 at 11:03:09 AM UTC-7, Kyle Maxwell wrote: > > Hi, I wanted to check in here about an issue I am having, that may be a > bug. I am updating an element from Polymer 0.5 core-localstorage to 1.0 > iron-localstorage. I noticed one inconsistency related to the fact that > localStorage.getItem returns null when an item doesn't exist. This was > handled appropriately in core-localstorage, but in iron-localstorage, the > value is explicitly set to null, when localStorage is empty. This means on > the first load of my element everything that is using local storage is set > to null, which causes some number of problems. I wanted to see if this > logic is sound, before creating an issue on github. > Thanks, > Kyle > > > https://github.com/PolymerElements/iron-localstorage/blob/master/iron-localstorage.html > Line 186: > this.value = null; > ... > > > https://github.com/Polymer/core-localstorage/blob/master/core-localstorage.html > Explained on line 90: > // localStorage has a flaw that makes it difficult to determine > ... > Follow Polymer on Google+: plus.google.com/107187849809354688692 --- You received this message because you are subscribed to the Google Groups "Polymer" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/6f61e91e-4561-4dd2-9140-712cc52de5b7%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
