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

Re-enable EffectScope.active in public TypeScript types #6186

Closed
andrewcourtice opened this issue Jun 27, 2022 · 0 comments · Fixed by #6187
Closed

Re-enable EffectScope.active in public TypeScript types #6186

andrewcourtice opened this issue Jun 27, 2022 · 0 comments · Fixed by #6187

Comments

@andrewcourtice
Copy link

Vue version

3.2.37

Link to minimal reproduction

https://stackblitz.com/edit/vitejs-vite-98hvi1?file=src%2Fmain.ts&terminal=dev

Steps to reproduce

Attempt to access the active property of an effectScope in a TypeScript project.

What is expected?

The active property should be publicly accessible as Vue provides no other (public) means for checking whether a scope is active.

What is actually happening?

The active property is excluded in public types.

System Info

No response

Any additional comments?

I understand some members of the EffectScope type have been excluded from the published typings as they are considered internal:

export declare class EffectScope {
    /* Excluded from this release type: active */
    /* Excluded from this release type: effects */
    /* Excluded from this release type: cleanups */
    /* Excluded from this release type: parent */
    /* Excluded from this release type: scopes */
    /* Excluded from this release type: index */
    constructor(detached?: boolean);
    run<T>(fn: () => T): T | undefined;
    /* Excluded from this release type: on */
    /* Excluded from this release type: off */
    stop(fromParent?: boolean): void;
}

Marking most of these members as internal makes sense, however, some library authors such as myself rely on the active property of an effectScope to check whether a scope is currently active.

As far as I am aware there is no alternative method for checking whether a scope is currently active.

Bear in mind this is purely a compile-time issue and does not affect runtime operation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants