althaf
08/23/2022, 7:28 AMclass VerifyAppIntegrityUseCase(
val authRepository: AuthRepository,
val workbenchUserRepository: WorkbenchUserRepository,
val menuRepository: MenuRepository,
val subscriptionRepository: SubscriptionRepository,
val adkarRepository: AdkarRepository,
val securedKeyValueStoreRepository: SecuredKeyValueStoreRepository,
>>> dispatcher: CoroutineDispatcher
) :
AuthenticatedFlowUseCase<Unit, Unit>(authRepository, dispatcher), UseCaseScope
class VerifyAppIntegrityUseCase(
val authRepository: AuthRepository,
val workbenchUserRepository: WorkbenchUserRepository,
val menuRepository: MenuRepository,
val subscriptionRepository: SubscriptionRepository,
val adkarRepository: AdkarRepository,
val securedKeyValueStoreRepository: SecuredKeyValueStoreRepository,
>>> val dispatcher: CoroutineDispatcher
) :
AuthenticatedFlowUseCase<Unit, Unit>(authRepository, dispatcher), UseCaseScope
why would kotlin give such a dual option here, both options allow us to pass it to the Super class constructorPaul Woitaschek
08/23/2022, 7:42 AMCiaran Sloan
08/23/2022, 9:11 AMval
on the constructor property, you are defining this as a global variable in the class, which is instantiated in the constructor.
In the case of not specifying val
the property is not a global variable, but is just a constructor scoped property that can only be used when the instance of the class is being generated via the constructor.