@Module
@InstallIn(ViewModelComponent::class)
class HiltModule {
@Provides
fun provideAuthentication(): FirebaseAuth = Firebase.auth
}
Now I'm learning Kotlin. I think if I want to use an instance, I should do it below.
@Module
@InstallIn(ViewModelComponent::class)
class HiltModule {
@Provides
fun provideAuthentication(){
FirebaseAuth = Firebase.auth()
}
}
But this is not right. why not use Firebase.auth(), using Firebase.auth issue it's instance?
And I have another question. why not using "{}" in fun provideAuthentication(),using only ":" gets property?