Skip to content

Export RefImpl #2025

@SebastianSpeitel

Description

@SebastianSpeitel

What problem does this feature solve?

I would like to extend RefImpl to create a Ref which can hold more state.
Currently I would have to use customRef because I can't create a valid Ref object by myself without knowing RefSymbol, which is not exported either.

// Use the provided getters/setters
class MyRef<T> extends RefImpl<T>{
    get value(){
       //... do stuff
       return super.value;
    }
    //...
}

// Override the tracking
class MyRef2<T> extends RefImpl<T>{
    get value(){
       track(toRaw(this), "get" /* GET */, 'value');
       //... do stuff
       return this._value;
    }
    //...
}

What does the proposed API look like?

Just export the class and maybe look into setting properties as private or protected.

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