This would allow built components to be cached if the same parameters are provided (or some kind of same 'key' is provided).
A mount() method, corresponding to the existing unmount(), would only run the first time a component is built and allow for separating that sort of behaviour.
Some code for these behaviours is already sitting unused in the library.
One of the main motivations for this is preserving the scroll position of screens when a subscreen is opened.
The state update manager may need to be refactored somewhat to deal with updates to states for screens not currently viewed (as the rebuilds should only be scheduled for when that screen is re-opened!). Currently, I believe the whole screen is rebuilt upon returning (same behaviour as opening a screen), but with caching this may not refresh all states that have been updated.
This would allow built components to be cached if the same parameters are provided (or some kind of same 'key' is provided).
A mount() method, corresponding to the existing unmount(), would only run the first time a component is built and allow for separating that sort of behaviour.
Some code for these behaviours is already sitting unused in the library.
One of the main motivations for this is preserving the scroll position of screens when a subscreen is opened.
The state update manager may need to be refactored somewhat to deal with updates to states for screens not currently viewed (as the rebuilds should only be scheduled for when that screen is re-opened!). Currently, I believe the whole screen is rebuilt upon returning (same behaviour as opening a screen), but with caching this may not refresh all states that have been updated.