Merseyside
10/06/2023, 12:09 PMscoped {
val accountId: Id? = getOrNull<Id>()
if (accountId != null) {
GetProfileFlowInteractor(get(), get(), accountId)
} else null
}
If i'm not, how can I provide this accountId and use it to avoid declaring this definition at all?Pedro Francisco de Sousa Neto
10/06/2023, 12:52 PMscoped<GetProfileFlowInteractor> { (Id?: accountId) ->
GetProfileFlowInteractorImpl(
abc = get(),
otherThing = get(),
accountId = accountId,
)
}
And you can retrieve this like:
123 is your accountId parameter
val profileFlow = get<GetProfileFlowInteractor> { parametersOf(123) }
Of course, you need to handle nullability behaviours of accountId inside GetProfileFlowInteractorImpl
.Pedro Francisco de Sousa Neto
10/06/2023, 12:53 PMGetProfileFlowInteractor
.
You will need create some logic like… profileFlow.hasAccountId()
or profileFlow.hasValidId()
.Merseyside
10/06/2023, 1:37 PMPedro Francisco de Sousa Neto
10/06/2023, 2:53 PMscoped<GetProfileFlowInteractor?>
. Can you test this?arnaud.giuliani
10/06/2023, 3:22 PMgetOrNull
or injectOrNull
if you wantarnaud.giuliani
10/06/2023, 3:22 PMMerseyside
10/06/2023, 3:35 PMarnaud.giuliani
10/06/2023, 4:18 PMis it an argument? or part of your scopeCopy codeval accountId: Id? = getOrNull<Id>()
Merseyside
10/07/2023, 9:43 AMarnaud.giuliani
10/09/2023, 12:02 PMscope.declare(scopeId)
Merseyside
10/10/2023, 10:41 AM