Thank you. One more thing: Is there a way to make ...
# arrow
h
Thank you. One more thing: Is there a way to make your code working without callbacks? My repository code:
Copy code
interface UserRepository: ReactiveCrudRepository<UserDto, String> {
  fun findByLogin(login: String): Mono<UserDto>
}
And service:
Copy code
class UserServiceImpl(
  private val userRepository: UserRepository
) : UserService {
  override fun insertUser(user: User): IO<Either<Error, User>> =
    userRepository.save(UserDto.fromDomain(user)).map { it.toDomain() }.toIO()

  override fun getUserByLogin(login: Login): IO<Either<Error, User>> =
    userRepository.findByLogin(login.value).map { it.toDomain() }.toIO()
}

fun <T>Mono<Either<T, User>>.toIO(): IO<Either<T, User>> = TODO()