Skip to content

Commit

Permalink
Add mutableStateFlow for PublishingEvent as a possibility for use whe…
Browse files Browse the repository at this point in the history
…n launching the bottom sheet
  • Loading branch information
zwarm committed Feb 19, 2024
1 parent 2de8b96 commit 8110f8d
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import androidx.lifecycle.LifecycleRegistry
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.flow.MutableStateFlow
import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode
Expand Down Expand Up @@ -39,6 +40,9 @@ class PublishingViewModel @Inject constructor(
private val _uiState = MutableLiveData<PublishingEvent>()
val uiState: LiveData<PublishingEvent> = _uiState

private val _uiStateFlow = MutableStateFlow<PublishingEvent>(PublishingEvent.ReadyToUpload)
val uiStateFlow: MutableStateFlow<PublishingEvent> = _uiStateFlow

init {
dispatcher.register(this)
EventBus.getDefault().register(this)
Expand Down

0 comments on commit 8110f8d

Please sign in to comment.