Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
class MyComponent(private val myRepository: MyRepository): CoroutineScope by CoroutineScope(Dispatchers.IO) {
private val _mySharedFlow = MutableSharedFlow<Int>(2, 3, BufferOverflow.DROP_OLDEST)
val mySharedFlow: SharedFlow<Int>
get() = _mySharedFlow
fun fetchAndEmitList() = launch {
myRepository.getList().forEach {
log("Emitting => $it")
fun release() {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment