ursus
08/02/2025, 9:45 PMkey(..) { .. }
to me? I do understand remember(key) { .. }
and side effects etc, but I just cannot wrap my head around it. I never use it in daily practise, yet I see it in some more exotic compose code.
It kinda looks like remember
but .. isn't?MR3Y
08/02/2025, 9:49 PMursus
08/02/2025, 9:51 PMMR3Y
08/02/2025, 9:56 PMursus
08/02/2025, 9:56 PMMR3Y
08/02/2025, 10:16 PMursus
08/02/2025, 10:29 PMZach Klippenstein (he/him) [MOD]
08/03/2025, 1:36 AMursus
08/03/2025, 7:54 PMshikasd
08/04/2025, 12:34 AMfor (item in list) {
key (item.key) { ItemContent(item) }
}
Without keys here it will work as well, but if, for example, you remove item N from the list, Compose will try to compose item N + 1 into content that previously was created for slot N and that is way more expensive than just removing the group for item N (which happens with key
). Internally, key
is inlined into a "movable" group that can reorder content with that identity within parent, which also is not possible with regular "positional" groupsursus
08/04/2025, 12:35 AMeygraber
08/04/2025, 2:55 AM