Skip to content

Commit

Permalink
chore: trim non-public properties on EffectScope type
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Apr 12, 2022
1 parent f44087e commit ea6fc84
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions packages/reactivity/src/effectScope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit ea6fc84

Please sign in to comment.