-
Notifications
You must be signed in to change notification settings - Fork 10
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
[🚀] Add Koin Integration #62
Comments
it would be perfect, sometimes I don't want to provide anything explicitly, but still use it, for example, in the plugin with dependency that provided somewhere at the top. In brief, my case is the following: |
Thanks for the feedback, unfortunately koin did not make it to 3.0, but yeah, I'm thinking of exactly the same use-case. It's going to be worked on next after I add some more docs. But your use-case is already possible with existing tools. You could grab the setup from docs or the sample app and create a plugin: fun <S: MVIState, I: MVIIntent, A: MVIAction> authOnErrorPlugin(
onSignInNeeded: suspend () -> Unit
) = plugin<S, I, A> {
onException { e ->
if (e !is UnauthorizedException) return@onException e
onSignInNeeded()
null
}
} In An even better approach would be to observe the current user object in |
Your way seems reasonable, but I just don't like singletons (and at the same time, I don't want to provide to every screen component this handler). For now I think about some way around Decompose to provide such handler from the top (but a bit busy with university at the moment). |
Description (required)
The text was updated successfully, but these errors were encountered: