You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let's say I have a composable with some dependencies.
@RootNavGraph
@Composable
@Destination
funSomeScreen(
dependency1:Dependency1,
dependency2:Dependency2,
)
...
DestinationsNavHost(
navGraph =NavGraphs.root,
dependenciesContainerBuilder = {
dependency(dependency1)
// dependency(dependency2) force a compile error if we forget to satisfy this dependency.
},
)
is there a way to ensure that the dependencies of the above composable are satisfied at compile time like dagger/hilt does instead of doing it at runtime?
this to avoid forgetting to pass the dependency and realise about it once the whole project has been compiled and run.
The text was updated successfully, but these errors were encountered:
I already thought of this, but the thing is people can choose to manually call their Composables, at which point it's really impossible to tell at compile time whether there is a missing dependency or the developer is just doing that (calling it manually).
Maybe we could use some other annotation to explicitly tell the library that we're doing that..
I'll keep this open as a possible future enhancement.
I also don't think that this is a major issue as the app crashes at the earliest chance and the developer will surely notice it once they run the app. As you said, the only issue is losing some time for builds..
let's say I have a composable with some dependencies.
is there a way to ensure that the dependencies of the above composable are satisfied at compile time like dagger/hilt does instead of doing it at runtime?
this to avoid forgetting to pass the dependency and realise about it once the whole project has been compiled and run.
The text was updated successfully, but these errors were encountered: