Skip to main content

Jetpack Compose module

The module provides ContainerHost extensions for easy subscription from Composables.

Including the module


Subscribing to a ContainerHost in Compose

Use the method below to subscribe to a ContainerHost in Compose.

The functions safely follow the Composable lifecycle and will automatically subscribe only if the view is at least STARTED.

fun SomeScreen(viewModel: SomeViewModel) {
val state by viewModel.collectAsState()

viewModel.collectSideEffect {
when(it) {

state = state