Jetpack compose and fragments

Viewed 196

If there is some lifecycle related event like unSubscribe or dispose, how is it possible to use compose without fragments' lifecycle?

1 Answers

If you need to observe lifecycle events on the fragment or activity, you can use LocalLifecycleOwner.

If you want to subscribe to some observable and ensure it gets disposed when the composable leaves the comosition, you can use Disposable Effect.

Related