JSFiddle - React, Tailwind, and code Playground

by skirtle

HTML

<script src="https://unpkg.com/[email protected]/dist/vue.global.js"></script>

JavaScript

const { reactive, watch } = Vue

const item = reactive({
  position: {
    x: 1,
    y: 2
  }
})

watch([() => item.position.x, () => item.position.y], ([newX, newY], [oldX, oldY]) => {
  console.log('handler called', newX, newY, oldX, oldY)
})

item.position.x = 3