diff options
author | Allan Wang <me@allanwang.ca> | 2021-11-23 11:50:06 -0800 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2021-11-23 11:50:06 -0800 |
commit | 0c97abd838ee834ef17d1b2e746fa26ea9663bd5 (patch) | |
tree | f90e3f5110e6e4fe724b9c2fde125769cd0d36fd /app/src/main/kotlin/com/pitchedapps/frost/views/FrostContentView.kt | |
parent | 30d6fd9d33e17110726a299749b058416ed77ecf (diff) | |
download | frost-0c97abd838ee834ef17d1b2e746fa26ea9663bd5.tar.gz frost-0c97abd838ee834ef17d1b2e746fa26ea9663bd5.tar.bz2 frost-0c97abd838ee834ef17d1b2e746fa26ea9663bd5.zip |
Create extension for converting emitters
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/views/FrostContentView.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/views/FrostContentView.kt | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/views/FrostContentView.kt b/app/src/main/kotlin/com/pitchedapps/frost/views/FrostContentView.kt index 75d1ffe4..f9d04ad1 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/views/FrostContentView.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/views/FrostContentView.kt @@ -41,6 +41,7 @@ import com.pitchedapps.frost.injectors.ThemeProvider import com.pitchedapps.frost.prefs.Prefs import com.pitchedapps.frost.utils.L import com.pitchedapps.frost.web.FrostEmitter +import com.pitchedapps.frost.web.asFrostEmitter import dagger.hilt.android.AndroidEntryPoint import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.ExperimentalCoroutinesApi @@ -139,22 +140,19 @@ abstract class FrostContentViewBase( override val refreshFlow: SharedFlow<Boolean> = refreshMutableFlow.asSharedFlow() - override val refreshEmit: FrostEmitter<Boolean> = - FrostEmitter { refreshMutableFlow.tryEmit(it) } + override val refreshEmit: FrostEmitter<Boolean> = refreshMutableFlow.asFrostEmitter() private val progressMutableFlow = MutableStateFlow(0) override val progressFlow: SharedFlow<Int> = progressMutableFlow.asSharedFlow() - override val progressEmit: FrostEmitter<Int> = - FrostEmitter { progressMutableFlow.tryEmit(it) } + override val progressEmit: FrostEmitter<Int> = progressMutableFlow.asFrostEmitter() private val titleMutableFlow = MutableStateFlow("") override val titleFlow: SharedFlow<String> = titleMutableFlow.asSharedFlow() - override val titleEmit: FrostEmitter<String> = - FrostEmitter { titleMutableFlow.tryEmit(it) } + override val titleEmit: FrostEmitter<String> = titleMutableFlow.asFrostEmitter() override lateinit var scope: CoroutineScope |