diff options
author | Allan Wang <me@allanwang.ca> | 2021-11-22 22:24:17 -0800 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2021-11-22 22:24:17 -0800 |
commit | 1dd7be9174f1740aa1cae29f6d62d6f83f5917ba (patch) | |
tree | 5734afee77ddd8ea498df7065a1ec3de28a387f7 /app/src/main/kotlin/com/pitchedapps/frost/contracts/FrostContentContract.kt | |
parent | eb2e0d07f278eb2079666ffabcbee007173c17af (diff) | |
download | frost-1dd7be9174f1740aa1cae29f6d62d6f83f5917ba.tar.gz frost-1dd7be9174f1740aa1cae29f6d62d6f83f5917ba.tar.bz2 frost-1dd7be9174f1740aa1cae29f6d62d6f83f5917ba.zip |
Migrate refresh channel to flow
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/contracts/FrostContentContract.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/contracts/FrostContentContract.kt | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/contracts/FrostContentContract.kt b/app/src/main/kotlin/com/pitchedapps/frost/contracts/FrostContentContract.kt index b8d0d86f..1d429138 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/contracts/FrostContentContract.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/contracts/FrostContentContract.kt @@ -18,9 +18,11 @@ package com.pitchedapps.frost.contracts import android.view.View import com.pitchedapps.frost.facebook.FbItem +import com.pitchedapps.frost.web.FrostEmitter import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.channels.BroadcastChannel +import kotlinx.coroutines.flow.SharedFlow /** * Created by Allan Wang on 20/12/17. @@ -56,7 +58,9 @@ interface FrostContentParent : DynamicUiContract { /** * Observable to get data on whether view is refreshing or not */ - val refreshChannel: BroadcastChannel<Boolean> + val refreshFlow: SharedFlow<Boolean> + + val refreshEmit: FrostEmitter<Boolean> /** * Observable to get data on refresh progress, with range [0, 100] @@ -124,17 +128,15 @@ interface FrostContentCore : DynamicUiContract { * Reference to parent * Bound through calling [FrostContentParent.bind] */ - var parent: FrostContentParent + val parent: FrostContentParent /** * Initializes view through given [container] * * The content may be free to extract other data from * the container if necessary - * - * [parent] must be bounded before calling this! */ - fun bind(container: FrostContentContainer): View + fun bind(parent: FrostContentParent, container: FrostContentContainer): View /** * Call to reload wrapped data |