Question about atomized modifications to SnapshotStateList

42 Views Asked by At

I am using SnapshotStateList to maintain a list of Elements to feed the compose UI.

When I add, remove, and replace elements to this list, they trigger my LazyColumn component to recompose. this all works fine.

However, if during one of the background data transfers, I find that I need to modify two elements in the list. The modification of these two elements is done by separate statements, then it may trigger the interface to recompose twice.

How can I atomize the modifications and make sure that both modifications trigger only one recompose event?

0

There are 0 best solutions below