Alex Styl
01/28/2025, 5:35 AMDisposableEffect
but for modifiers.
I am implementing a Drag and Drop Modifier and I am keeping track of each target's coordinates in an object. I would like to delete those coords/'unregister' them when the composable is no longer in the compositionAlex Styl
01/28/2025, 9:55 AMModifier.composed{}
. just spottedLouis Pullen-Freilich [G]
01/28/2025, 11:31 AMcomposed
is generally discouraged. If you are using modifier.node APIs you can use onDetach
to manage logic here. Or you could just make your modifier factory function @Composable
, and add DisposableEffect
thereAlex Styl
01/28/2025, 12:06 PMcomposed
discouraged? marking my modifier with @Composable
felt like a code smell to meLouis Pullen-Freilich [G]
01/28/2025, 12:07 PMLouis Pullen-Freilich [G]
01/28/2025, 12:08 PMAlex Styl
01/28/2025, 12:11 PMAlex Styl
01/28/2025, 12:11 PM