store.sync() 回调回调、store、sync

2023-09-07 16:38:20 作者:孤

store.sync() 有回调吗?

Is there a callback for store.sync()?

我正在努力:

store.sync(function(){
   alert('1');
});

但它不起作用.该商店是本地商店.

but it does not work. The store is a local store.

推荐答案

sync() 没有回调".为了实现这个行为,你需要监听 store 的 write 事件.检查此解决方案.

There is no 'callback' for sync(). In order to achieve this behaviour, you will need to listen to the store's write event. Check this solution.