How to tell at which array index a new element was added at an event handler for an array node in a SharedTree DDS? #25354
Unanswered
SampoSyrjanen
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm wondering if there is a way to figure out the index of an array element that was inserted in a SharedTree array node. In the old Fluid 1.0 SharedString, you could get the index directly from the change event. The event had a "ranges" property which contained the index property. I'm looking for the same thing in the new SharedTree DDS, but cannot find a way to do it.
There is this example in the Fluid repo: here https://github.com/microsoft/FluidFramework/blob/main/examples/apps/tree-comparison/src/model/newTreeInventoryList.ts
Looking at the example, it seems that there is an auxiliary map data structure for tracking changes. When a tree change event happens, this map is referred to and the actual change that occurred is figured out. This looks like the thing I need at my event handling, but is this the only way to do it? And in particular, what is the way to do this without using any legacy or internal APIs?
Beta Was this translation helpful? Give feedback.
All reactions