Kweku
05/20/2020, 11:21 PMArtyom Degtyarev [JB]
05/21/2020, 10:39 AMKweku
05/21/2020, 10:55 AMclass Interactor(
private val Repository: RepositoryInterface,
private val success: (List<Type>) -> Unit,
private val failure: Error) -> Unit): InteractorInterface
I'm using partial application to pass in the repository using DI then the two functions are added by whatever class that uses the Interactor. The interactorCreator function already has the repository passed in it
class Controller( private val interactorCreator:((List<Type>) -> Unit), ((Error) -> Unit)) -> InteractorInterface)
So in the first case unit becomes void but in the second it becomes KotlinUnit when exported as a Objc framework meaning that the functions can't be passed into the constructor. I've searched around and it's normal behaviour for Unit and I don't think it's possible to get the second type to convert to Void so am looking to get the first type to convert to KotlinUnit