olshevski / compose-navigation-reimagined

🌈 Type-safe navigation library for Jetpack Compose
https://olshevski.github.io/compose-navigation-reimagined/
MIT License
545 stars 18 forks source link

How do you do dependency injection here? #35

Closed hi-brylle closed 5 months ago

hi-brylle commented 6 months ago

I ask for a recommended architecture of how Repositories can be instantiated using this library. Manual dependency injection for now (because I want to learn it before using Hilt).

Thank you :)

olshevski commented 5 months ago

@hi-brylle Sorry for the late response. Have you already found the answer to your question?

The library does not impose any particular way to instantiate classes or use DI. I'm not even sure what exactly you want to know. Is there any particular problem you want to solve?

hi-brylle commented 5 months ago

Hello, yes, I have already found a solution to my problem: just some simple constructor injection for my top-level Composable function containing compose-navigation-reimagined code). Thank you for the reply though.

People looking for a more proper DI solution should not follow what I did here in my app's prototype.