Is their a need to wrap a DAO Room coroutine funct...
# coroutines
r
Is their a need to wrap a DAO Room coroutine function with a withcontext(Dispatcher.io) block. Example
Query()
suspend fun getUser():User
Repository
suspend fun getUserFromDb():User {
return withcontext (<http://dispatcher.IO|dispatcher.IO>) {return data.getUser()}
}
Or does room handle making this db call on the background thread?
k
#room
👍 1
m
no need. just use suspend. room uses their own dispatchers
👍 1
2