pakoito
04/30/2019, 9:35 AMfun <Type> IO<Type>.useCase(ok: (Type) -> Unit, error: (Throwable) -> Unit): IO<Unit> =
defer(IO) { this@useCase }
.continueOn(Main)
.flatMap { t -> delay { ok(t) } }
.handleErrorWith { err -> delay { error(err) } }