After localStorage.clear() or deleteRecord() in my Ember.js app, local storage data are resurrected

后端 未结 2 1125
我在风中等你
我在风中等你 2021-01-13 20:13

I\'m observing a data resurrection after localStorage.clear() or deleteRecord() (jsbin example) is called in my ember app.

Follow these ste

2条回答
  •  心在旅途
    2021-01-13 20:39

    Problem fixed in September's version of Ember Data/Local Storage. See it in action in this SO Answer with a jsbin.

    After some discussions with folks on IRC, there is currently a bug in LSAdapter or in Ember Data that causes the data to linger around.

    The problem is on pause as of August 2013 due to imminent changes in Ember Data.

    The work-around for this problem is to both clear the Local Storage as well as the ember data. See it working in this jsbin.

    Alternatively, you can immediately call location.reload() after clearing local storage to show the fresh data.

提交回复
热议问题