Skip to content

Persisted state across argument changes #1165

@scottmessinger

Description

@scottmessinger

Hi! We're looking at upgrading from can-get-used-to-this and was wondering about the issue of persisting state across argument changes. According to the class based resource library, persisted state isn't natively supported by a function approach.

Just to make sure I understand, this means that the output will change it's identify in JS (e.g. a new object is created) when arguments change. If I'm right, that's a massive performance issue as a resource is often used to return a model which anchors the entire UI. Changing an argument would cause the entire UI to rerender. This seems like such an problematic choice, I'm assuming I must be misunderstanding it or I'm just unaware of a relatively easy and accessible solution.

Could you provide any insight on this? How can the function approach to resources return stable objects as the arguments change? If that's not possible, how are the performance implications mitigated?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions