https://kotlinlang.org logo
#compose
Title
# compose
c

Colton Idle

01/21/2022, 4:50 AM
SideEffect{}
is triggered on a successful composition. Let's say all I'm doing is incrementing a variable in that block. What if I wanted to increment on every composition (successful and "failed"). Is there any sideEffect type block for that? Or would I just put that in my composable without any sideeffect-esque {} and that basically counts as failed + successful compositions?
z

Zach Klippenstein (he/him) [MOD]

01/21/2022, 4:32 PM
You would probably just put such a thing directly in a composable. But unless you're trying to get information about composition itself, it's probably the wrong thing to do.
c

Colton Idle

01/21/2022, 9:59 PM
I don't actually want to do this. I guess I'm just learning about SideEffect and trying to figure out if there's a mirror for whats essentially
SideEffectForEachSuccessfulRecomposition{}