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 211f5b7 commit b7b8950Copy full SHA for b7b8950
packages/reactivity/__tests__/effect.spec.ts
@@ -505,6 +505,18 @@ describe('reactivity/effect', () => {
505
expect(dummy).toBe(1)
506
})
507
508
+ it('lazy', () => {
509
+ const obj = reactive({ foo: 1 })
510
+ let dummy
511
+ const runner = effect(() => (dummy = obj.foo), { lazy: true })
512
+ expect(dummy).toBe(undefined)
513
+
514
+ expect(runner()).toBe(1)
515
+ expect(dummy).toBe(1)
516
+ obj.foo = 2
517
+ expect(dummy).toBe(2)
518
+ })
519
520
it('scheduler', () => {
521
let runner: any, dummy
522
const scheduler = jest.fn(_runner => {
0 commit comments