I don't understand the real difference between the curly braces and and the normal brackets in Kotlin when using RxJava. For example, I have the following code which works as expected:
someMethodThatReturnsCompletable()
.andThen(anotherMethodThatReturnsACompletable())
.subscribe(...)
但以下方法不起作用:
someMethodThatReturnsCompletable()
.andThen { anotherMethodThatReturnsACompletable() }
.subscribe(...)
请注意链的andThen()
个部分与大括号的不同之处.我不明白这两者有什么不同.我看过一些文章,但不幸的是,我仍然难以理解这个细微的区别.