https://kotlinlang.org logo
#dagger
Title
# dagger
m

Mohammed Akram Hussain

12/07/2023, 2:58 PM
Is there a way to provide a dependency after making a network call or operation which can be injected anywhere and is scoped to the application?
j

juliocbcotta

12/07/2023, 3:06 PM
Well, you can create some Observable/Flow that will emit the results of an operation... It just need to be a singleton inside a given scope..
b

Brais Gabin

12/07/2023, 4:53 PM
You can do whatever you want inside a
@Provides
function. Just do the call and block the thread until you get the value. Or instead of inject the value you can inject a provider of that value.