Gopal S Akshintala
01/15/2020, 10:34 AMinterface FetcherDependencies<F>: MonadThrow<F> {
fun api(): ApiService
companion object {
operator fun invoke(ME: MonadThrow<F>, api: ApiService): FetcherDependencies =
object: FetcherDependencies, MonadThrow<F> by ME {
override fun api() = api
}
}
}Egor Trutenko
01/15/2020, 10:53 AMGopal S Akshintala
01/15/2020, 10:55 AMEgor Trutenko
01/15/2020, 4:59 PMfun FetcherDependencies<F>.something()
Then, within something you can flatMap, throw etc. and also access ApiService through api().