// muze byt samozrejme pouzito i s reactive, 
// je to jen demonstrace tovarny kde se pouziva this,
// namisto 03 - composable jak se bezne pouziva

<script setup>
import { ref, reactive } from 'vue'


const createCounter = (i) => ({
/* this = 
  {id: 4, count: RefImpl, increment: ƒ, decrement: ƒ}
*/
  id: i,
  count: ref(0),
  increment() {
    this.count.value += 1;
  },
  decrement() {
    this.count.value -= 1;
  },
});

const listOfCounters = [];
for (let i = 0; i < 10; i++) {
  listOfCounters.push(createCounter(i));
}

</script>