Created
September 21, 2021 09:46
-
-
Save burnoo/57c49aeee74d5dace485781c4652c3f0 to your computer and use it in GitHub Desktop.
Medium Cokoin 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun Hello() { | |
val hello = get<Hello>() | |
Text(hello.text) | |
} | |
val previewModule = module { | |
factory { Hello(text = "preview hello text") } | |
} | |
@Preview | |
@Composable | |
fun HelloPreview() { | |
Koin(appDeclaration = { modules(previewModule) }) { | |
Hello() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment