enighma
09/27/2021, 11:04 PM@JvmSuppressWildcards
Adding that to the constructor injection site did the trick. @ephemient thank you! 🙂
Update 1:
In my use-case below MyType
was a sealed class, which is what caused the issue.
Original message:
I think this question applies here even though I'm using hilt:
I have a provider function that provides a kotlinflow like so:
fun provideX(): Flow<MyType>
However, when I try to compile I get "cannot be provided without an @Provides-annotated method". I'm guessing it wants a provider for MyType?
I'm not sure, because it seems to work if it's:
fun provideX(): Flow<Long>
I guess in general, are there any recommendation around flows/async together with dagger/hilt?ephemient
09/27/2021, 11:20 PM@JvmSuppressWildcards
enighma
09/27/2021, 11:32 PM@JvmSuppressWildcards
@Provides
fun providesTokenImpl(tokenManager: TokenManager): StateFlow<Token> {
and Token is a sealed class:
sealed class Token
object NoToken : Token()
data class RealToken(
If I change the provides to StateFlow<RealToken>
it works 😕