I could see that the way I launch Flow is the difference here, but why LaunchedEffect worked and the later didn’t.
d
Doris Liu
08/17/2021, 11:22 PM
The flow in the first snippet gets re-created when recomposed. The new flow gets launched while the previous flow is still emitting.
The second snippet would only recreate the flow when the key to the
LaunchedEffect
changes. When it does, the previous job will be canceled. So you won't be seeing multiple flows competing to emit new target for the animation.