经典的
const a = doSth()
if(a) {
const b = doOtherThing(a)
if (b) {
...
return xxx
}
}
return yyy
提供什么 pipe chain flow 有啥用,连这个常见的 pattern 都抽象不出来还搞啥 functional programming
而 optional chain 又不是 kotlin 有 scope 函数可以灵活调整 receiver ,结果只能取值或者取函数进行调用