In many Apps the full user-interface state is only kept for what is currently being displayed and the App code handles navigation from page to page or view to view. Opening, closing and re-creating views, state and data as needed.
In the Kontekst Apps we keep the full App state as if all pages and views are open at the same time. This allows us to easily adopt the Apps to different devices and an increasing available display surface. From the minimal view of a mobile phone to a full-blown multi widescreen desktop setup.
The App state is separated from the display code and hooked in using event streams where each stream is the current data for a page or part of a view. When a change occurs the display code listens to the stream and updates with the data from the event. When the user interacts with the display an event is created and sent to a sink (input to a stream). The state code handles incoming events on sinks and creates outgoing events on streams according to the business logic of the App. A single incoming event can result in multiple outgoing events updating different parts of the user-interface.
Take an App for accessing multiple e-mail accounts at the same time. On mobile it would consist of a list of inboxes where the user can select to open one. The App would navigate to a list of e-emails in that inbox and further on to open one of the e-mails. When the App runs on devices with bigger display the view would change to display the list of e-mails and an open e-mail at the same time. Even expanding to show the list of inboxes, e-mails and an e-email.