https://kotlinlang.org logo
o

Ofir Bar

03/12/2020, 8:53 AM
Hey guys, I have 3 methods inside a
ViewModel
in the image below, calling methods on some repository. All methods attempt to do the same thing: Fetch a value from the local DB (a Room DB), suspend the method execution until that value is fetched so the method is guaranteed to return a value. In each method I added a comment that specifies what issue I have with this method. What is the safe and correct way to accomplish what I am trying to do?