Skip to content

Creating a standalone ref/computed properties inside setup. #2057

Closed
@an-sh

Description

@an-sh

Version

3.0.0-rc.10

Reproduction link

https://github.com/an-sh/standalone-computed-test

Steps to reproduce

Create a singleton class with ref and computed properties inside component's setup.

Use a singleton instance in a component that goes through several mount/unmount cycles.

What is expected?

ref and computed properties should behave the same way

What is actually happening?

Ref property stays reactive for all component instances , however a computed property will stop being reactive after the first component instance is unmounted.


Not sure what exactly should happen, it is easy to assume that anything created during a setup call should be coupled with a components life-cycle. But i don't see any options to enforce ref/computed values to be indefinitely global or be disposed at a certain point outside of components logic (like rxjs unsubscribe).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions