2
是record.set同步還是異步?如果我想確保在record.set之後放置的代碼在文檔完全更新時執行,那麼我應該使用record.whenReady(function(){...})來包裝我的代碼?在record.set之後調用record.whenReady是否有意義?
考慮代碼如下所示:
var record = ds.record.getRecord(`table/${id}`);
record.whenReady(function() {
record.set('field', 'value');
// do I need whenReady here?
// code that should be executed when document is updated
})
我明白了,謝謝! –