dave08
01/17/2019, 5:50 PMTransformations.map { } using suspend functions in the mapping?louiscad
01/17/2019, 5:53 PMLiveData subclass, and using switchMap to instantiate it.
Can you tell more about your use case? Maybe there's another simpler way to satisfy it.dave08
01/17/2019, 5:54 PMLiveData from a Room request and need to make a network call (using a suspend function) to add something to the result before passing it along to the View. @louiscadlouiscad
01/17/2019, 6:10 PMsuspend functions in DAOs, and if you're stuck to older version for some reason, you can still make your DAO an abstract class, call a protected abstract blocking function and wrap its call using withContext(<http://Dispatchers.IO|Dispatchers.IO>) { … }
No need for LiveData here. If you need self updating features of LiveData, you should use Transformations.switchMap, and have the LiveData doing the network call be instantiated with the value of the other LiveData you get from Room.dave08
01/18/2019, 3:44 AMlouiscad
01/18/2019, 7:29 AM