YousefED / SyncedStore

SyncedStore CRDT is an easy-to-use library for building live, collaborative applications that sync automatically.

Home Page:https://syncedstore.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Supporting array assignment

pierscowburn opened this issue · comments

Thanks again for a great library – it continues to be super useful in our application!

I noticed that there's a reference in the code to array assignment not being supported, and have run across this when trying to use array assignment on an upcoming feature. I was wondering if you had an idea as to how much work is required in order to support this – i.e. are there gotchas you're aware of that lead to the decision not to support it yet?

Here is how to set an array value at some specific index when using synced store and Yjs:

myArray.splice(index, 1, newValue);

The reason array assignment is not supported is explained here: #59

You could indeed use splice as a workaround