I have been creating an SMS app. I have a list of conversations stored in Room
database as ConversationEntity
.
This is my query:
@Query("SELECT * FROM conversation_entity ORDER BY timestamp DESC")
fun getAllConversations(): Flow<List<ConversationEntity>>
I would like to observe (collect) data from this query inside my repository class, but I have to map it to a List<Conversation>
. I know how to collect this data, I known to map List<ConversationEntity>
into List<Conversation>
. But I have no idea how should I emit list of conversations?
I tried things like emit second flow from the first one, or use MutableStateFlow and set date by .value