On the InterestsScreen when a user taps on a topic, 2 things happen:
- a navigation event which pushes
TopicNavKey(topicId) on to the back stack
InterestsViewModel is updated with the selected topic Id
This violates SSOT because the currently selected topic Id is now stored in 2 places. We should come up with a better way of doing this. Ideas:
- Have
InterestsViewModel derive the current selected topic id from the TopicNavKey on the back stack. This would require InterestsViewModel having access to NavigationState.
- Pass the
navigator to InterestsViewModel. Then its onTopicClick method can navigate as well as updating its own currently selected topic ID (still violates SSOT but is architecturally better and simpler to implement).