import { ref, onBeforeUnmount } from 'vue'
import emitter from '/@/utils/emitter'

export default function useProductlineId() {
  const productlineId = ref('')
  emitter.on('ProductSelectCard-cardId', (value: any) => {
    productlineId.value = value.productlineId
  })
  emitter.on('TopFilters-selectValue', (value: any) => {
    productlineId.value = value.selectValue
  })

  onBeforeUnmount(() => {
    emitter.all.clear()
    // console.log('cleared')
  })
  return { productlineId }
}

