import { defineStore } from 'pinia'
import { getUserQestionNum } from '@/api'
import { createCachedFetcher } from './helpers'

/**
 * 问吧数据
 */
export const useQuestionStore = defineStore('question', () => {
  const userQestionNum = ref<number>(0)

  const fetchUserQestionNum = createCachedFetcher(getUserQestionNum, (data) => {
    userQestionNum.value = data
  })
  return { userQestionNum, fetchUserQestionNum }
})
