df
11/29/2020, 4:56 PMclass SomeClass { fun CoroutineScope.producer() = produce { ... } }
or is it
class SomeClass { fun producer(scope: CoroutineScrope) = scope.produce { ... } }
or should (for some reasons) those methods never be methods but just functions? If it's the first one, do I really need to invoke it via
with(obj) { producer() }
? If it's second one, do I just want to pass in this
? Might sound random but I still find myself frequently in a situation where I know how something can be done but never why.Zach Klippenstein (he/him) [MOD]
11/30/2020, 2:02 PMIn
suffix. Eg flow’s produceIn
, launchIn
df
11/30/2020, 5:29 PM