thelumiereguy
11/30/2022, 6:37 PMSnapshot.withMutableSnapshot {
itemList.forEach { item -> _messagesStateMap[someIndex] = item }
}
Would this be a proper usecase for Snapshot? I dont want to trigger UI Update on every iteration of the loop
So, with this, I guess it’ll only trigger update after the apply
is called. What do you guys think?Alex Vanyo
11/30/2022, 7:03 PMSnapshot.withMutableSnapshot
is probably not needed.
If you’re on a background thread instead, that story changes a bit and Snapshot.withMutableSnapshot
would help ensure what you mentioned.
This thread has some previous discussion in this area:
https://kotlinlang.slack.com/archives/CJLTWPH7S/p1641896888250700Zach Klippenstein (he/him) [MOD]
11/30/2022, 11:36 PMthelumiereguy
12/01/2022, 2:06 AM