Zoltan Demant
10/30/2023, 9:47 AMfun interface User { fun userId(): String? }
• by inject in single {}
• get()
in the actual function call
single {
val authService by inject<AuthService>()
SomeService(
context = get(),
user = {
// get<AuthService>().user()?.id
val user = authService.user()
user?.id
},
)
}
arnaud.giuliani
10/30/2023, 3:41 PMarnaud.giuliani
10/30/2023, 3:42 PMget<AuthService>()
directlyPedro Alberto
12/23/2023, 9:12 PM