fix(reactivity): ensure computed always expose value

fix #3099

Also changes the original fix for #910 by moving the fix from
reactivity to the scheduler
This commit is contained in:
Evan You
2021-05-27 20:53:21 -04:00
parent 32e21333dd
commit 03a7a73148
5 changed files with 52 additions and 42 deletions

View File

@@ -193,4 +193,10 @@ describe('reactivity/computed', () => {
expect(isReadonly(z)).toBe(false)
expect(isReadonly(z.value.a)).toBe(false)
})
it('should expose value when stopped', () => {
const x = computed(() => 1)
stop(x.effect)
expect(x.value).toBe(1)
})
})