This repository was archived by the owner on Jan 1, 2025. It is now read-only.
[recoil-sync] Support transactional updateItems() in RecoilSync #2017
Labels
Component: recoil-sync
Related to recoil-sync
enhancement
New feature or request
help wanted
Extra attention is needed
When syncing from an external store to recoil in the
listen
prop of RecoilSync, each call toupdateItem(k, v)
notifies components associated with each atom's key. However, since not all the state is synced yet (more synchronousupdateItem()
calls pending), some components will observe a "partially" synced state, which can cause errors.In my case, this is making some components observe deleted state that would otherwise be consistent if all updates were applied before components get notified.
Using updateAllKnownItems might work, but in my case, the number of atoms is vast and updates are often, so this will do a lot of unnecessary work (assuming updateAllKnownItems has transaction semantics).
The text was updated successfully, but these errors were encountered: