Does applyPatches call onPatches synchronously? #550
finallyblueskies
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm building my own optimistically updating, offline compatible, realtime UI (🫠) and one of the things that has been bothering me is the application of patches from things like remote updates, patch rewinds etc without triggering server sync onPatches (in effect "silent" patches)
Copying from the mobx-keystone yjs integration, I've settled on using:
But I'm a bit surprised by how well this works. All this time I was under the impression that onPatches is fired asynchronously and we cannot assume that onPatches would be called within the applyPatches execution context. My question is - is the above a reliable method of preventing incoming patches from being propagated again? And if so, why? I'd like to understand how this works from a JS lang standpoint.
Beta Was this translation helpful? Give feedback.
All reactions