Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Koin 3.6.0 Wasm support #359

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Koin 3.6.0 Wasm support #359

wants to merge 1 commit into from

Conversation

Shusshu
Copy link
Contributor

@Shusshu Shusshu commented Mar 7, 2024

Koin support WASM as of version 3.6.0 currently in alpha.

@DevSrSouza
Copy link
Collaborator

I think we should wait until Koin stable release, if someone wants to try Koin and Voyager.

Copying this two functions should be enough:

@Composable
public inline fun <reified T : ScreenModel> Screen.getScreenModel(
    qualifier: Qualifier? = null,
    noinline parameters: ParametersDefinition? = null
): T {
    val koin = getKoin()
    return rememberScreenModel(tag = qualifier?.value) { koin.get(qualifier, parameters) }
}

@Composable
public inline fun <reified T : ScreenModel> Navigator.getNavigatorScreenModel(
    qualifier: Qualifier? = null,
    noinline parameters: ParametersDefinition? = null
): T {
    val koin = getKoin()
    return rememberNavigatorScreenModel(tag = qualifier?.value) { koin.get(qualifier, parameters) }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants