From: Evan You Date: Tue, 12 Apr 2022 07:56:57 +0000 (+0800) Subject: chore: trim non-public properties on EffectScope type X-Git-Tag: v3.2.32~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea6fc845f25f454e7264720001c9ed18414252b9;p=thirdparty%2Fvuejs%2Fcore.git chore: trim non-public properties on EffectScope type --- diff --git a/packages/reactivity/src/effectScope.ts b/packages/reactivity/src/effectScope.ts index 01499c5a78..e80a4f61d1 100644 --- a/packages/reactivity/src/effectScope.ts +++ b/packages/reactivity/src/effectScope.ts @@ -4,21 +4,33 @@ import { warn } from './warning' let activeEffectScope: EffectScope | undefined export class EffectScope { + /** + * @internal + */ active = true + /** + * @internal + */ effects: ReactiveEffect[] = [] + /** + * @internal + */ cleanups: (() => void)[] = [] /** * only assinged by undetached scope + * @internal */ parent: EffectScope | undefined /** * record undetached scopes + * @internal */ scopes: EffectScope[] | undefined /** * track a child scope's index in its parent's scopes array for optimized * removal + * @internal */ private index: number | undefined @@ -46,10 +58,18 @@ export class EffectScope { } } + /** + * This should only be called on non-detached scopes + * @internal + */ on() { activeEffectScope = this } + /** + * This should only be called on non-detached scopes + * @internal + */ off() { activeEffectScope = this.parent }