Has someone integrated Dagger in such a way where dagger provides Screen composables? if so, how, ifi ts just
() -> @Composable Unit
lamdas? Qualifieres everywhere? Or maybe some typesafe object based Screen? is that a bad idea? (since it doesnt really compose if needed, same way fragments sort of did)
b
Bradleycorn
11/21/2021, 2:41 PM
I’m not sure how this would work, or why you would need it?
The purpose of dagger (or any DI framework) is to create and inject instances of objects in a class, rather than the class having to create them itself. It exists to solve a problem where a class A that needs to use an instance of another class B needs to know the details about how to create an instance of B (which could mean creating instances of several other objects as well). But composables are not objects or classes, but just simple functions. There’s no instance to create, and thus there’s no problem to solve.
u
ursus
11/21/2021, 3:03 PM
Well Im mostly talking about instantiation of the viewmodels passed in, someone needs to construct them