Skip to content

Instantly share code, notes, and snippets.

@ycmjason
Created February 26, 2020 16:26
Show Gist options
  • Save ycmjason/fdbf7bf559c1c76a30afcb65937fccb8 to your computer and use it in GitHub Desktop.
Save ycmjason/fdbf7bf559c1c76a30afcb65937fccb8 to your computer and use it in GitHub Desktop.
const r1 = reactive({ isReady: false })
const r2 = reactive({ x: 1 })
setTimeout(() => {
r1.isReady = true
}, 1000)
setInterval(() => {
r2.x++
}, 500)
watch(() => {
if (!r1.isReady) return
console.log(`r2.x: ${r2.x}`)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment