Skip to content

Component caching option and mount() method #6

@valoeghese

Description

@valoeghese

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions