generalStoreData.ts
10 months ago
index.ts
10 months ago
modalStore.ts
10 months ago
settingsStore.ts
10 months ago
generalStoreData.ts
23 lines
| 1 | import { defineStore } from "pinia"; |
| 2 | import { ref } from "vue"; |
| 3 | |
| 4 | import { HostingerToolsData, STORE_PERSISTENT_KEYS } from "@/types"; |
| 5 | import { snakeToCamelObj } from "@/utils/services"; |
| 6 | |
| 7 | export const useGeneralStoreData = defineStore( |
| 8 | "generalStoreData", |
| 9 | () => { |
| 10 | const toolsData = ref<HostingerToolsData>( |
| 11 | // @ts-expect-error - hostinger_tools_data is a global variable |
| 12 | snakeToCamelObj(hostinger_tools_data) |
| 13 | ); |
| 14 | |
| 15 | return { |
| 16 | ...toolsData.value |
| 17 | }; |
| 18 | }, |
| 19 | { |
| 20 | persist: { key: STORE_PERSISTENT_KEYS.TOOLS_GENERAL_DATA_STORE } |
| 21 | } |
| 22 | ); |
| 23 |