Find LiveData.observe(...) calls inside @Composable

Proprietary

LiveData.observe(lifecycleOwner, observer) is for Activity/Fragment code; inside a @Composable it registers a brand-new observer on every recomposition and never removes it. Use observeAsState() (or migrate to StateFlow and collectAsStateWithLifecycle()).

org.openrewrite.kotlin.compose.FindLiveDataObserveInComposable$KtRecipe
mod run . --recipe='org.openrewrite.kotlin.compose.FindLiveDataObserveInComposable$KtRecipe'

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.