- Define a class for JetpackCompose to use
val DependencyName = staticCompositionLocalOf<InterfaceOfDependency?> { null }
- When initializing the JetpackCompose view:
CompositionLocalProvider(DependencyName provides objectForThatDependency { JetpackComposeView(...) }
- Use it in any
@Composablefunction in that scope:DependencyName.current?