Funkey
Funkey•5mo ago

Clear a RealtimeArray

I understand that we can't have a remove for a RealtimeArray to avoid race conditions, but clearing the entire array is a very useful operation for this powerful structure! Clearing it would make the structure even better! Let's clean data! 🧹
7 Replies
Mechabit
Mechabit•5mo ago
yeah that would be useful. the current workaround is to put the array inside a set, then you can clear the set to make a new array
jeremy
jeremy•5mo ago
This seems like it would be a very useful feature honestly
maxweisel
maxweisel•5mo ago
agreed. I’ll throw it on the list!
Funkey
Funkey•5mo ago
Thank you! I've tried the workaround and I've found a strange bug where changes aren't synced on a fresh model until one of the client leaves. This is a very powerful and useful feature that I would love to see! Just don't clear it off!
maxweisel
maxweisel•5mo ago
are you on the latest version of Normcore? this definitely shouldn’t be happening
HaRrY
HaRrY•3mo ago
Even if we wrap the RealtimeArray with RealtimeSet we wont get those nice event fires on RealtimeArray. it wont fire events if we subscribe to RealtimeSet.OnModelAdded. need this feature please
Mechabit
Mechabit•3mo ago
can't you just sub the events from the array within the set?