Stian Brandt
01/31/2021, 10:18 PMfun <F> Runtime<F>.loadNews(): Kind<F, List<NewsItem>> = fx.concurrent {
val response = !effect(context.bgDispatcher) { fetchNews() }
continueOn(context.mainDispatcher)
if (response.isSuccessful) {
response.news().toDomain()
} else {
!raiseError<List<NewsItem>>(response.code().toNetworkError())
}
}.handleErrorWith { error -> raiseError(error.normalizeError()) }
I get a deprecation warning on fx.concurrent: fx: MonadFx<F>' is deprecated. Overrides deprecated member in 'arrow.typeclasses.MonadError'. Fx will be moved to each datatype as a DSL constructor.
What is the correct way to handle this?raulraja
02/01/2021, 8:50 AMsuspend fun loadNews(): Either<YourCustomError, List<NewsItem>>
if it wasn’t kinded.