dart-archive / polymer_elements

https://pub.dartlang.org/packages/polymer_elements
BSD 3-Clause "New" or "Revised" License
24 stars 17 forks source link

iron-localstorage event #112

Closed terrywarwar closed 8 years ago

terrywarwar commented 8 years ago

I have the following listener which fires when I modify localstorage manually. However when the localstorage is modified using a declared <iron-localstorage></ron-localstorage> element the listener is not triggered.

ready() {
    window.onStorage.listen((e){
      print(e.key);
    });
  }
terrywarwar commented 8 years ago

Came across this http://stackoverflow.com/questions/4679023/bug-with-chromes-localstorage-implementation answer. I tried it in another tab and the handler gets triggered in the other windows. Any suggestions, should I use the fire() to trigger in the active window, or localStorage.setItem()?

terrywarwar commented 8 years ago

This is what I wanted to use, it looks like it maybe an enhancement https://github.com/PolymerElements/iron-localstorage/issues/19.