-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
ar_syncの通知・自動反映を待っていると、ラグが気になることがある
(ボタンを押したらすぐ何か変化があって欲しい、など)
appoloとかでやっているらしい、postしたら(そのレスポンスを元に)データいい感じに更新してくれるやつ
const newtitle = 'あたらしいタイトル'
await response = post('/post/3', { title: newtitle })
ArSync.foobarUpdateAllData('Post', 3, { title: response.title })const newtitle = 'あたらしいタイトル'
const patch = ArSync.foobarAddPatch('Post', 3, { title: newtitle }, { time: 10000 })
try {
await response = post('/post/3', { title: 'あたらしいタイトル' })
patch.invalidate()
ArSync.foobarUpdateAllData('Post', 3, { title: response.title })
} catch(e) {
patch.invalidate()
}こんな感じのAPI用意しとけばいいかな?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels