Kotlin Coroutines Flow with Room and state handling
问题 I'm trying out the new coroutine's flow, my goal is to make a simple repository that can fetch data from a web api and save it to db, also return a flow from the db. I'm using room and firebase as the web api, now everything seems pretty straight forward until i try to pass errors coming from the api to the ui. Since i get a flow from the database which only contains the data and no state, what is the correct approach to give it a state (like loading, content, error) by combining it with the