Skip to content

Commit

Permalink
Merge pull request #84 from Nexters/fix/fetch-mission-data-async
Browse files Browse the repository at this point in the history
미션 데이터 API 호출 시 동시 호출
  • Loading branch information
eshc123 authored Dec 22, 2024
2 parents 2b4fe3d + 0d8a21a commit 8cb77ec
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,19 +132,21 @@ class BoardViewModel @Inject constructor(

fun fetchMissionData() {
viewModelScope.launch {
getMissionBoards()
getMission()
getMissionVerification()
joinAll(
launch { getMission() },
launch { getMissionVerification() },
launch { getMissionBoards() }
)
}
}

fun refreshMissionData() {
viewModelScope.launch {
_isRefreshLoading.emit(true)
joinAll(
launch { getMissionBoards() },
launch { getMission() },
launch { getMissionVerification() }
launch { getMissionVerification() },
launch { getMissionBoards() }
)
_isRefreshLoading.emit(false)
}
Expand Down

0 comments on commit 8cb77ec

Please sign in to comment.