We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
monthChangeFlow
collectMonthChange()
1 parent dc95cbb commit a7774b4Copy full SHA for a7774b4
feature/main/src/main/java/com/twix/stats/StatsViewModel.kt
@@ -44,6 +44,13 @@ class StatsViewModel(
44
)
45
46
init {
47
+ collectMonthChange()
48
+ fetchInProgressStats(YearMonth.from(currentState.currentDate))
49
+ fetchCompletedStats()
50
+ collectEventBus()
51
+ }
52
+
53
+ private fun collectMonthChange() {
54
viewModelScope.launch {
55
56
.distinctUntilChanged()
@@ -52,10 +59,6 @@ class StatsViewModel(
59
fetchInProgressStats(yearMonth)
60
}
61
-
- fetchInProgressStats(YearMonth.from(currentState.currentDate))
57
- fetchCompletedStats()
58
- collectEventBus()
62
63
64
override suspend fun handleIntent(intent: StatsIntent) {
0 commit comments