Hi all, I have a weird bug with CMP and Room. I ha...
# multiplatform
a
Hi all, I have a weird bug with CMP and Room. I have two screens A and B. ViewModelA is subscribed to a room table through flow on init. After starting the app i go to screen B, modify the table, go back to screen A, everything works as expected A reacts to changes in the table done in B. Now that stops working after screen rotation. I worked around it by recollecting on rotation, but this is weird since vm is the same and initial collection job is active and fine. Does anyone have an idea?
s
You might be using
remember
instead of
rememberSaveable
, which persists after configuration changes
a
I am not using any of the remember stuff in the compose side, just injecting with koinViewModel the view model then rendering the StateFlow value through collectAsLifecycleState()