Skip to content

Commit

Permalink
#121 [MOD] : suspend -> scope 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Eonji-sw committed Nov 26, 2024
1 parent c957ec8 commit 68fd94c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions feature/news/src/main/java/com/teamwable/news/NewsViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,17 @@ class NewsViewModel

suspend fun getNewsNumberFromLocal() = userInfoRepository.getNewsNumber().first()

suspend fun saveNewsNumber(newsNumber: Int) = userInfoRepository.saveNewsNumber(newsNumber)
fun saveNewsNumber(newsNumber: Int) {
viewModelScope.launch {
userInfoRepository.saveNewsNumber(newsNumber)
}
}

suspend fun getNoticeNumberFromLocal() = userInfoRepository.getNoticeNumber().first()

suspend fun saveNoticeNumber(noticeNumber: Int) = userInfoRepository.saveNoticeNumber(noticeNumber)
fun saveNoticeNumber(noticeNumber: Int) {
viewModelScope.launch {
userInfoRepository.saveNoticeNumber(noticeNumber)
}
}
}

0 comments on commit 68fd94c

Please sign in to comment.