Chris Paul
06/14/2021, 11:25 AMreturn newStockItem.right()
.flatMap { checkFirstThing(newStockItem) }
.flatMap { checkSecondThing(newStockItem) }
vs
return checkFirstThing(newStockItem)
.flatMap { checkSecondThing(newStockItem) }
I find the first a little more readable but does mean extra box operations.Satyam Agarwal
06/14/2021, 11:29 AMeither {
checkFirstThing(newStockItem).bind()
checkSecondThing(newStockItem).bind()
}
Chris Paul
06/14/2021, 11:29 AMSatyam Agarwal
06/14/2021, 11:30 AMChris Paul
06/14/2021, 11:30 AMChris Paul
06/14/2021, 11:31 AM