udacity / andfun-kotlin-sleep-tracker

Other
90 stars 206 forks source link

Why were the withContext(Dispatchers.IO) removed from the suspended functions on SleepTrackerViewModel #32

Closed jpduran closed 2 years ago

jpduran commented 3 years ago

Commit 75ef93

HasanElHefnawy commented 2 years ago

In Commit 10723fd, room-ktx was added in app/build.gradle and suspend was added in SleepDatabaseDao.kt. The solution using withContext was before the following change in Version 2.1.0

Couroutines: DAO methods can now be suspend functions. Include room-ktx in your dependencies to take advantage of this functionality