Skip to content

Instantly share code, notes, and snippets.

@theboreddev
Created Oct 27, 2021
Embed
What would you like to do?
Using flatMap
fun generatePayrollFor(employeeName: String): Either<Problem, Payroll> {
return employeeService.findEmployeeByName(employeeName)
.flatMap { employee ->
buildPayrollForEmployee(employee)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment