Skip to content

Instantly share code, notes, and snippets.

@raineorshine
Created January 15, 2024 16:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raineorshine/6ec8613d466c5aad3adeac6ad62f4c18 to your computer and use it in GitHub Desktop.
Save raineorshine/6ec8613d466c5aad3adeac6ad62f4c18 to your computer and use it in GitHub Desktop.
YJS FAQ

Frequently asked questions on https://discuss.yjs.dev

How to set initial data without duplication?

The recommended approach is to have the client (or server) who creates the Doc populate it with initial data. All other clients should sync before editing.

Full discussion: https://discuss.yjs.dev/t/initial-offline-value-of-a-shared-document/465

As far as I know it's not possible to selectively apply or broadcast some updates and not others. As soon as you skip an update, that Doc has a "hole" in it. No other updates will work as YJS will wait for the missing update, ensuring that updates are not applied out-of-order.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment