* fix(watch): ignore lazy option in simple watch
* test: ignore lazy option in simple watch
expect(cb).toHaveBeenCalled()
})
+ it('ignore lazy', async () => {
+ const count = ref(0)
+ let dummy
+ watch(
+ () => {
+ dummy = count.value
+ },
+ { lazy: true }
+ )
+ expect(dummy).toBeUndefined()
+
+ await nextTick()
+ expect(dummy).toBe(0)
+
+ count.value++
+ await nextTick()
+ expect(dummy).toBe(1)
+ })
+
it('onTrack', async () => {
const events: DebuggerEvent[] = []
let dummy
scheduler: applyCb ? () => scheduler(applyCb) : scheduler
})
- if (!lazy) {
+ if (!lazy || !cb) {
if (applyCb) {
scheduler(applyCb)
} else {