pablisco
07/10/2019, 8:13 AMgildor
07/10/2019, 8:16 AMalsoWithContext
, but probably a bit long (for already quite long withContex)gildor
07/10/2019, 8:17 AMhmole
07/10/2019, 8:51 AMfuture
chaingildor
07/10/2019, 8:53 AMalso { withContext(Main) {} }
gildor
07/10/2019, 8:55 AMlet
is definitely needed if we have `also`…Paulius Ruminas
07/10/2019, 10:55 AMalsoOn
breaks the "chain" and has no return type. This looks like Future\Promise
style API which you can avoid by using suspending functions. For me at least that is why coroutines are so awesome because you can avoid the Future\Promise
style of code.Dico
07/10/2019, 11:41 AMDico
07/10/2019, 11:41 AMDico
07/10/2019, 11:42 AMletWithContext
should be treated with more priority hereRobert Menke
07/10/2019, 1:45 PMgildor
07/10/2019, 2:07 PMPaulius Ruminas
07/10/2019, 4:52 PMalsoOn doesn't break the chain, it returns receiverohh it works like
.also { ... }
and returns the previous value. But is a function like also
considered an operator function? It is mostly used for side effects. I considered an operator function to be like F(x) = Y
not F(x) = F(x)
. Is there a definition for what "operator function" is?pablisco
07/10/2019, 5:35 PMpablisco
07/10/2019, 5:37 PMpablisco
07/10/2019, 10:17 PMwickedev
07/11/2019, 2:50 AMgildor
07/11/2019, 3:14 AMlaunch
wickedev
07/11/2019, 3:32 AMwickedev
07/11/2019, 3:47 AMgildor
07/11/2019, 3:55 AMgildor
07/11/2019, 3:56 AMwickedev
07/11/2019, 4:00 AMwickedev
07/11/2019, 4:05 AMPaulius Ruminas
07/11/2019, 5:58 AMAlso, @Paulius Ruminas, updating the Ui is literally a side effectYes that's why I personally don't like chaining it with data transforming operations. 🙂 That's why I think before snippet is more clear. I don't really see the point of making an extension function for that reason. But probably there is no "better" way here some people will like the before snippet some will like the after snippet.