How do you achieve calling a suspending function l...
# compose
k
How do you achieve calling a suspending function like snapTo of Animatable inside the draggable modifier callbacks? I tried this and it does not work
Copy code
val scale = Animatable(0f)
Modifier.draggable(onDrag = {
     LaunchedEffect("test"){
      scale.snapTo(0.5f)  
  }
}
s
You could get a CoroutineScope through
rememberCoroutineScope()
and launch with that.
k
Thanks
👍 1