HostDefaultProvider


An interface that allows the hosting environment (e.g., Android, Desktop, or iOS) to provide default values for CompositionLocal using compositionLocalWithHostDefaultOf.

This acts as a decoupling layer, allowing platform-agnostic libraries to request platform-specific components ((like LifecycleOwner or ViewModelStoreOwner) without depending on platform-specific APIs or artifacts.

Summary

Public functions

T
<T : Any?> getHostDefault(key: HostDefaultKey<T>)

Retrieves a value associated with key from the host environment.

Cmn

Public functions

getHostDefault

fun <T : Any?> getHostDefault(key: HostDefaultKey<T>): T

Retrieves a value associated with key from the host environment.