withCompositionLocals

Functions summary

inline T
@Composable
<T : Any?> withCompositionLocals(
    vararg values: ProvidedValue<*>,
    content: @Composable () -> T
)

withCompositionLocals binds values to ProvidableCompositionLocal key and returns the result produced by the content lambda.

Cmn

Functions

withCompositionLocals

@Composable
inline fun <T : Any?> withCompositionLocals(
    vararg values: ProvidedValue<*>,
    content: @Composable () -> T
): T

withCompositionLocals binds values to ProvidableCompositionLocal key and returns the result produced by the content lambda. Use with non-unit returning content lambdas or else use CompositionLocalProvider. Reading the CompositionLocal using CompositionLocal.current will return the values provided in CompositionLocalProvider's values parameter for all composable functions called directly or indirectly in the content lambda.