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
}
}
+ /**
+ * 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
}