Closed
Description
flowOf(1)
.onEach {
Timber.d("timer: $it ${Thread.currentThread().name} ${currentCoroutineContext()[ContinuationInterceptor]}")
}
.flowOn(Dispatchers.Main)
.onEach {
Timber.d("timer [1]: $it ${Thread.currentThread().name} ${currentCoroutineContext()[ContinuationInterceptor]}")
}
.launchIn(viewModelScope)
// viewModelScope's context is SupervisorJob() + Dispatchers.Main.immediate
Console
timer: 1 main Dispatchers.Main.immediate
timer [1]: 1 main Dispatchers.Main.immediate