Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scope cache functionality #554

Closed
YevgeniyShunevych opened this issue Sep 22, 2021 · 0 comments
Closed

Scope cache functionality #554

YevgeniyShunevych opened this issue Sep 22, 2021 · 0 comments
Assignees
Labels
Milestone

Comments

@YevgeniyShunevych
Copy link
Member

YevgeniyShunevych commented Sep 22, 2021

The functionality that adds component scope element caching. This feature is aimed to increase performance of subsequent component access requests.

UsesScopeCacheAttribute

Indicates that the scope cache of the component should be used. Caches a scope element of a component when it is requested at first time, then returns the cached element instance on further scope requests.

Usage

Apply cache to certain control

[UsesScopeCache]
public TextInput<_> SomeInput { get; private set; }

Apply cache to page object and its children

[UsesScopeCache(TargetSelfAndChildren = true)]
public class SomePage : Page<_>
{
    //...
}

Apply cache to table row and clear on "Remove" button click

[UsesScopeCache(TargetSelfAndChildren = true)]
public class UserTableRow : TableRow<_>
{
    public Text<_> FirstName { get; private set; }

    public Text<_> LastName { get; private set; }

    [ClearCache(Of = ClearCacheTarget.Parent)]
    public Button<_> Remove { get; private set; }
}
@YevgeniyShunevych YevgeniyShunevych added this to the 1.13.0 milestone Sep 22, 2021
@YevgeniyShunevych YevgeniyShunevych self-assigned this Sep 22, 2021
YevgeniyShunevych added a commit that referenced this issue Oct 20, 2021
- #562 Value cache functionality.
- #554 Scope cache functionality.
- #554 Scope cache functionality.
- #557 Table column header texts cache functionality.
- #561 New `UsesCacheAttribute`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant