Skip to content

Commit 001a1e6

Browse files
[autofix.ci] apply automated fixes
1 parent 1f63cf6 commit 001a1e6

File tree

1 file changed

+27
-16
lines changed

1 file changed

+27
-16
lines changed

packages/reactivity/src/effectScope.ts

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,15 @@ export class EffectScope {
4040
prevEffectScope: EffectScope | undefined
4141
nextEffectScope: EffectScope | undefined
4242

43-
4443
constructor(public detached = false) {
4544
this.parent = activeEffectScope
4645
if (!detached && activeEffectScope) {
4746
if (activeEffectScope.scopesTail) {
48-
this.prevEffectScope = activeEffectScope.scopesTail;
49-
activeEffectScope.scopesTail.nextEffectScope = this;
50-
activeEffectScope.scopesTail = this;
47+
this.prevEffectScope = activeEffectScope.scopesTail
48+
activeEffectScope.scopesTail.nextEffectScope = this
49+
activeEffectScope.scopesTail = this
5150
} else {
52-
activeEffectScope.scopes = activeEffectScope.scopesTail = this;
51+
activeEffectScope.scopes = activeEffectScope.scopesTail = this
5352
}
5453
}
5554
}
@@ -61,8 +60,12 @@ export class EffectScope {
6160
pause(): void {
6261
if (this._active) {
6362
this._isPaused = true
64-
for (let child = this.scopes; child != undefined; child = child.nextEffectScope) {
65-
child.pause();
63+
for (
64+
let child = this.scopes;
65+
child != undefined;
66+
child = child.nextEffectScope
67+
) {
68+
child.pause()
6669
}
6770
for (let i = 0, l = this.effects.length; i < l; i++) {
6871
this.effects[i].pause()
@@ -77,8 +80,12 @@ export class EffectScope {
7780
if (this._active) {
7881
if (this._isPaused) {
7982
this._isPaused = false
80-
for (let child = this.scopes; child != undefined; child = child.nextEffectScope) {
81-
child.resume();
83+
for (
84+
let child = this.scopes;
85+
child != undefined;
86+
child = child.nextEffectScope
87+
) {
88+
child.resume()
8289
}
8390
for (let i = 0, l = this.effects.length; i < l; i++) {
8491
this.effects[i].resume()
@@ -138,24 +145,28 @@ export class EffectScope {
138145
}
139146
this.cleanups.length = 0
140147

141-
for (let child = this.scopes; child != undefined; child = child.nextEffectScope) {
142-
child.stop(true);
148+
for (
149+
let child = this.scopes;
150+
child != undefined;
151+
child = child.nextEffectScope
152+
) {
153+
child.stop(true)
143154
}
144-
this.scopes = this.scopesTail = undefined;
155+
this.scopes = this.scopesTail = undefined
145156

146157
// nested scope, dereference from parent to avoid memory leaks
147158
if (!this.detached && this.parent && !fromParent) {
148159
if (this.prevEffectScope) {
149-
this.prevEffectScope.nextEffectScope = this.nextEffectScope;
160+
this.prevEffectScope.nextEffectScope = this.nextEffectScope
150161
}
151162
if (this.nextEffectScope) {
152-
this.nextEffectScope.prevEffectScope = this.prevEffectScope;
163+
this.nextEffectScope.prevEffectScope = this.prevEffectScope
153164
}
154165
if (this.parent.scopes == this) {
155-
this.parent.scopes = this.nextEffectScope;
166+
this.parent.scopes = this.nextEffectScope
156167
}
157168
if (this.parent.scopesTail == this) {
158-
this.parent.scopesTail = this.prevEffectScope;
169+
this.parent.scopesTail = this.prevEffectScope
159170
}
160171
}
161172
this.parent = undefined

0 commit comments

Comments
 (0)