[MERGE] Reacting when chunks are modified


I would like to be able to react upon chunk modification. There is a setChunks StateEffect that would allow me to do this but is not exposed by the API.
What would be the proper way to react when chunks are updated? Would exposing setChunks be something possible?

You could compare the chunks on the old state and the chunks on the new state on state updates.

I reckon it would work but it means that I would need to perform the calculation the see if the chunks have changed for every state update (could potentially lead to performance issue for a document with lot of chunks?).

For accessing the chunks I guess I would need to use the exposed getChunks function?

Just compare the chunk arrays by identity. If they stay the same, they’ll be the same array.