I'm curious why <the documentation> for `launchIn`...
# flow
r
I'm curious why the documentation for
launchIn
says this:
Copy code
Note that the resulting value of launchIn is not used and the provided scope takes care of cancellation.
Why is that the case?
launchIn
returns a
Job
, and if I call
.cancel()
on that job, it does seem to cancel the flow. Am I missing something?
e
* of the example
r
@ephemient, sorry, i'm not sure i follow
e
in the example, the resulting value is not used. the job belongs to the provided scope (
uiScope
) and will be cancelled when it is cancelled.
☝️ 1
r
seems like we could just remove that line from the documentation and avoid any confusion.
submitted a PR to clarify the docs: https://github.com/Kotlin/kotlinx.coroutines/pull/4144