Skip to content

Instantly share code, notes, and snippets.

View sme-shyl001's full-sized avatar
🐵

Roman Shylo sme-shyl001

🐵
View GitHub Profile
@cbeyls
cbeyls / FlowExt.kt
Created May 28, 2022 16:32
Synchronize Flow emissions with SharedFlow's subscriptionCount
package be.digitalia.flow
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.Job
import kotlinx.coroutines.channels.BufferOverflow
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.FlowCollector
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.MutableStateFlow