Subscribe on changes!

immediate didn't work in `watch([()=>undefined]`

avatar
Oct 12th 2022

Vue version

3.2.40

Link to minimal reproduction

https://sfc.vuejs.org/#eNp9kc1ugzAQhF9l6wupRKC9IojaW9+gh7oHB5bECf7R2iQHxLt3DVFatVIPSMzu7CfNeBKv3heXEUUl6tCS9hECxtHvpNXGO4owAWGfw1XF9ggz9OQMZHyRSStt62yIYMIBmmTbZG84DA7eHQ3dQ/b4bVE3w2g77LXFbtkt0M2H+sxh89jsJmkBVHFRw4jsf0oynbsBi8EdNlJYB560jTloY7DTKiJ0urNZhKujsxSMnXOY7tsq0ogzTwHWry7XmByQRUTjB7axAqj3Y4zOwks76PbcSKGaZyl2i6rLdbkYVQXTpOY50e4EkYu1sa1RvjgFZ7nTJZG8LYIUfJgmacYVJi3FMUYfqrIMfZte4hQKR4eS/woabdQGCwxmuyd3DUgMliL/wSh5eEHaEnKzhPQf85f1DzdhOdQs5i9oGrle

Steps to reproduce

const a = ref(undefined);

watch([a], ()=>{
  console.log('no print, immediate didn't work')
}, {immediate:true});

What is expected?

immediate:true working

What is actually happening?

immediate:true didn't work

System Info

No response

Any additional comments?

No response

avatar
Oct 12th 2022

duplicate of #5032