polymer - core-localstorage doesn't save when modifying (rather than replacing) a value -


i have holds hash of responses core-ajax. idea is, if it's in cache present right away , replace when ajax round trip completes successfully.

<core-ajax auto            url="/some/rest/path"            on-core-response="{{setdetail}}"            on-core-error="{{_setdetail}}"            handleas="json"></core-ajax>  <core-localstorage id="detail-storage"                     name="category-detail-storage"                    value="{{cacheddetails}}"></core-localstorage> 

setdetail looks like....

polymer({... ..., setdetail: function(e,detail) {               var response = detail.response;              if(response != null) {                this.cacheddetails[this.id] = response;              }              _setdetail(); // pulls cache            },...}) 

the problem i'm running into, assigning key in cacheddetails doesn't trigger change event, , therefore save method in core-localstorage leaves me digging shadowroot of element trigger save manually, like...

this.shadowroot.queryselector('#detail-storage').save(); 

does seem erroneous else? when replace item in other uses of core-localstorage seems work fine...

you can put this:

<core-ajax auto        url="/some/rest/path"        on-core-response="{{setdetail}}"        on-core-error="{{_setdetail}}"        handleas="json"></core-ajax>  <core-localstorage id="detail-storage"        name="category-detail-storage"       value="{{setdetail}}"> </core-localstorage> 

Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -