YousefED / SyncedStore

SyncedStore CRDT is an easy-to-use library for building live, collaborative applications that sync automatically.
https://syncedstore.org
MIT License
1.71k stars 51 forks source link

Yjs transact #66

Closed skomlaebri closed 2 years ago

skomlaebri commented 2 years ago

Hi,

is there a way in SyncedStore to do doc transact as in Yjs, to reduce the number of update calls?

gustavotoyota commented 2 years ago

Pretty simple:

const doc = getYjsValue(store)

doc.transact(() => {
  // Transaction
})
skomlaebri commented 2 years ago

Thanks, that what I ended up doing, I was curious to know if there was a way to avoid the conversion and not having to handle everything with the yjs Syntax.

YousefED commented 2 years ago

At this moment there's no build in SyncedStore transactions, but the proposed method should work well!