šŸ›‘ Stop using LaunchedEffect for passing an Argument to a ViewModel

This title could be clearer and more informative.Try out Clickbait Shieldfor free (5 uses left this month).

Using LaunchedEffect to pass navigation arguments to a ViewModel is a common but suboptimal pattern. Two cleaner alternatives exist: using Koin's parametersHolder to pass dynamic parameters directly when initializing the ViewModel (keeping data-loading logic private inside the ViewModel), or using SavedStateHandle to extract navigation arguments. The Koin parametersHolder approach avoids polluting composable screens with side-effect blocks and encapsulates initialization logic within the ViewModel itself.

•4m watch time

Sort: