<script setup lang="ts">
import { ref, watch } from 'vue'
import { useBackendEvents } from '@/common/backendEvents'
import { currentUserId } from '@/stores/auth'

const userId = ref(currentUserId.value)

watch(currentUserId, (id) => {
  userId.value = id
})

// Always call useBackendEvents in setup, passing the reactive userId
useBackendEvents(userId)
</script>

<template>
  <div></div>
</template>
