<@UJBKXD0HH> Which of the two is the recommended w...
# compose
k
@Adam Powell Which of the two is the recommended way of accessing ambients inside composable functions?
Copy code
1.
val density = DensityAmbient.current
//The code that uses density

2.
Providers(DensityAmbient provides density){
    // The code that use density
}
a
1 is the consumer and 2 is the producer. If you do 1 in code called from inside the block of 2, it will yield the provided value.