voben
launch
launchWhenStarted
launchWhenResumed
onViewCreated
viewLifecycleOwner.lifecycleScope.launchWhenResumed { }
tseisel
collect
flow.onEach { ... }.launchIn(viewLifecycleOwner.lifecycleScope)
scope.launch { flow.collect() }
Daniel
flow.launchIn(scope)
flowOf(0, 1, 2, 3) .filter { it % 2 == 0 } .map { it * it } .launchIn(scope)
val flow = flowOf(0, 1, 2, 3) .filter { it % 2 == 0 } .map { it * it } scope.launch { flow.collect() }
A modern programming language that makes developers happier.