Find LiveData.observe(this, observer) calls inside Fragment

Proprietary

Inside a Fragment, liveData.observe(this, observer) ties the subscription to the fragment's lifecycle — which outlives the view across onDestroyView/onCreateView recreation and produces dangling references to a destroyed view. Use viewLifecycleOwner instead.

org.openrewrite.kotlin.android.FindLifecycleObserveLiveData$KtRecipe
mod run . --recipe='org.openrewrite.kotlin.android.FindLifecycleObserveLiveData$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.