In `CoroutineScope(Dispatchers.Main + job)` the or...
# coroutines
m
In
CoroutineScope(Dispatchers.Main + job)
the order of contexts doesn’t matter and it’s the same if I call
CoroutineScope(job + Dispatchers.Main)
, right?
s
TL;DR Almost, but I suppose it doesn’t matter for end user. Both
Job
and
CoroutineDispatcher
are
CoroutineContext
and
fun operator plus
combines them and its subelements. But if element of context on the right side has same key as the element on the left side, that element with that key of the left side context won’t be used.
m
Got it, thank you!