Skip to content

Instantly share code, notes, and snippets.

- 2011
- Fragment (Tablet)
- 2013
- Android Studio
- Dagger 1.0
- OkHttp 1.0
- 2014
- Material Design
@atsuko-fukui
atsuko-fukui / FooService.kt
Created July 21, 2020 10:21
Example of Kotlin Coroutine Flow with multiple subscribers
package com.example.atsukofukui.fooexample
import com.google.common.truth.Truth.assertThat
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.channels.ConflatedBroadcastChannel
import kotlinx.coroutines.flow.asFlow
import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.flow.flowOn
import kotlinx.coroutines.flow.map