<@U06SJGA8AUF> I have a hack to get the updated de...
# compose-web
d
@Pau Marzo I have a hack to get the updated density as a StateFlow:
Copy code
package org.eski.ui.util

import androidx.compose.runtime.Composable
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.unit.Density
import kotlinx.coroutines.flow.MutableStateFlow

val screenDensity = MutableStateFlow<Density>(Density(1f))

@Composable fun DensityObserver() {
  with(LocalDensity.current) {
    screenDensity.value = this
  }
}
Just add the DensityObserver to the root composable
🦜 1