Hi all! I have a flow, which emits on database cha...
# coroutines
l
Hi all! I have a flow, which emits on database change. The query has a date parameter (today) which filters in the query on the data side. I have to detect the midnight and update the query to show correct data. Is there any good solutions to this?
b
You can make a flow that produces today date, and then you need to use flatMapLatest:
todayFlow.flatMapLatest { today -> dao.query(today) }
❤️ 2
l
Yeah, good point, thanks 🙂