import { UNDONE_COUNT } from '@/enums/cacheEnum'
import { useStorage } from '@vueuse/core'

export function useUndoneCount(initialValue?: number) {
  const undoneCount = useStorage(UNDONE_COUNT, initialValue)
  async function setCount(newCount: number) {
    undoneCount.value = newCount
  }

  return { undoneCount, setCount }
}
