I have a PWA with compose and I'm struggling to ha...
# compose-web
t
I have a PWA with compose and I'm struggling to have the data synced between tabs. For example, if an user create one item in a specific screen and it has the same screen open in another tab, ideally it should be synchronized to show the data. Is this possible? Is there some article or guide about this?
h
You can use the localstorage and its listener to create a mutable state using produceState
t
I'm currently using Room and struggling with some locks or something when syncing the data 🥲
h
t
This complicate things for me then, is there some alternative you recommend?
h
It really depends on your use case.
t
I'm storing some users preferences and around 1k objects of some music details
h
You could try some options from the documentation or try to limit queries to prevent a lock. Or use a notification pattern on top and have some kind of main tab or reduce the queries.
c
You might find this interesting: https://2026.kotlinconf.com/talks/1067499/
t
Very precise video recommendation @curioustechizen, thanks for the link. So if I understood it correctly: datastore supports my use case but Room doesn't. I guess my case is not a huge amount of data, so maybe I get get away migrating to some custom json storage + parsing using DataStore instead of room 🤔