-
-
Save theboreddev/39f10670a3954d8855fdc0e3e4d50360 to your computer and use it in GitHub Desktop.
!! operator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun generatePayrollFor(employeeName: String): Either<Problem, Payroll> { | |
return employeeService.findEmployeeByName(employeeName) | |
.flatMap { employee -> | |
buildPayrollForEmployee(employee!!) | |
}.tapLeft { | |
logger.info("Could not fetch employee: ${it.message()}") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment