Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b1d1f44 commit ad22879Copy full SHA for ad22879
‎packages/reactivity/__tests__/computed.spec.ts‎
@@ -619,6 +619,22 @@ describe('reactivity/computed', () => {
619
expect(COMPUTED_SIDE_EFFECT_WARN).toHaveBeenWarned()
620
})
621
622
+ it('should be recomputed without being affected by side effects', () => {
623
+ const v = ref(0)
624
+ const c1 = computed(() => {
625
+ v.value = 1
626
+ return 0
627
+ })
628
+ const c2 = computed(() => {
629
+ return v.value + ',' + c1.value
630
631
+
632
+ expect(c2.value).toBe('0,0')
633
634
+ expect(c2.value).toBe('1,0')
635
+ expect(COMPUTED_SIDE_EFFECT_WARN).toHaveBeenWarned()
636
637
638
it('debug: onTrigger (ref)', () => {
639
let events: DebuggerEvent[] = []
640
const onTrigger = vi.fn((e: DebuggerEvent) => {
0 commit comments