https://kotlinlang.org logo
Title
j

Javier

10/26/2020, 10:51 AM
I would like to be able to inject
@Composable
functions with Koin. An use case is abstracting the navigation to use the same interface for a Multiplatform project.
For example, I have this interface and this class
Then, the Koin module should be so
I checked how
rememberNavController
function creates the
NavHostController
, so
It is working on first use, but if you go back until you exit from the application and you open the app again, you got this error
java.lang.IllegalArgumentException: SavedStateProvider with the given key is already registered
I solved temporally the problem so, invoking
invoke()
function before any
Navigation
"go to" function is invoked
Should be great we can just use something like
a

arnaud.giuliani

10/26/2020, 11:03 AM
We need to check how we can handle that with Compose context, & recomposition 👍
👍 1
j

Javier

10/27/2020, 2:53 PM
Navigation artifact is using
composable
name, I think it should be the name to replace
single
for composables
composable { someComposableFunction() }
a

arnaud.giuliani

10/27/2020, 3:11 PM
clearly what I was thinking 👍