Pavel S
10/20/2023, 1:49 PMFlow
and an update method, or something like that, but with this approach you have to duplicate the state in both of them and also duplicate the boilerplate of subscribing to changes. Is there a more elegant option?Arkadii Ivanov
10/20/2023, 2:58 PMonSessionSelected
is called.
• SessionDetailsComponent - shows the clicked session.
The presentation depends on the type of the device. E.g. on a phone device, there is stack navigation, handled by ConferenceComponent.
On a large (e.g. tablet) device, there is MultiPaneComponent. It stores the navigation state, and calls SessionsComponent#onSessionSelectionChanged
to highlight the selected item. Indeed, the selection state is kinda duplicated (i.e. MultiPaneComonent
stores the navigation state, plus SessionsComponent
stores the selected session id. If you really want to avoid the duplication, you can pass a Flow/Observable to SessionsComponent
and just combine
it to the final component state. But from my point of view it's not a big deal.
Regardless of the duplication, every component is reusable.