Funkey
Funkey3mo 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
Mechabit3mo 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
jeremy3mo ago
This seems like it would be a very useful feature honestly
maxweisel
maxweisel3mo ago
agreed. I’ll throw it on the list!
Funkey
Funkey3mo 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
maxweisel3mo ago
are you on the latest version of Normcore? this definitely shouldn’t be happening
HaRrY
HaRrY2w 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
Mechabit2w ago
can't you just sub the events from the array within the set?