File tree 2 files changed +2
-21
lines changed
2 files changed +2
-21
lines changed Original file line number Diff line number Diff line change 6
6
TrackOpTypes ,
7
7
TriggerOpTypes ,
8
8
DebuggerEvent ,
9
- markRaw ,
10
- ref
9
+ markRaw
11
10
} from '../src/index'
12
11
import { ITERATE_KEY } from '../src/effect'
13
12
@@ -782,14 +781,4 @@ describe('reactivity/effect', () => {
782
781
expect ( dummy ) . toBe ( 0 )
783
782
expect ( record ) . toBeUndefined ( )
784
783
} )
785
-
786
- it ( 'should handle self dependency mutations' , ( ) => {
787
- const count = ref ( 0 )
788
- effect ( ( ) => {
789
- count . value ++
790
- } )
791
- expect ( count . value ) . toBe ( 1 )
792
- count . value = 10
793
- expect ( count . value ) . toBe ( 11 )
794
- } )
795
784
} )
Original file line number Diff line number Diff line change @@ -178,15 +178,7 @@ export function trigger(
178
178
const effects = new Set < ReactiveEffect > ( )
179
179
const add = ( effectsToAdd : Set < ReactiveEffect > | undefined ) => {
180
180
if ( effectsToAdd ) {
181
- effectsToAdd . forEach ( effect => {
182
- if ( effect !== activeEffect || ! shouldTrack ) {
183
- effects . add ( effect )
184
- } else {
185
- // the effect mutated its own dependency during its execution.
186
- // this can be caused by operations like foo.value++
187
- // do not trigger or we end in an infinite loop
188
- }
189
- } )
181
+ effectsToAdd . forEach ( effect => effects . add ( effect ) )
190
182
}
191
183
}
192
184
You can’t perform that action at this time.
0 commit comments