import { defineStore } from 'pinia'
import { ref, computed } from 'vue'
export const useGlobalStore = defineStore('global', () => {
	const state = ref({
		loading: false,
		unReadMessageCount: 0
	})

	const setLoading = (v: boolean) => {
		state.value.loading = v
	}

	const setUnredCount = (number: number) => {
		state.value.unReadMessageCount = number
	}
	return {
		state,
		setLoading,
		setUnredCount
	}
})
