Files
boursecu_landing/src/store/configStore.ts
T

23 lines
529 B
TypeScript
Raw Normal View History

import { ref } from 'vue'
import { defineStore } from 'pinia'
import { getTenantConfig } from '@/config/app-config'
2026-08-01 10:11:28 +03:30
export const useConfigStore = defineStore('config', () => {
const config = ref<Record<string, any> | null>(null)
2026-08-01 10:11:28 +03:30
function hydrateFromAppConfig() {
const tenant = getTenantConfig()
config.value = tenant && Object.keys(tenant).length > 0 ? tenant : null
}
2026-08-01 10:11:28 +03:30
async function getConfigData() {
hydrateFromAppConfig()
}
return {
config,
hydrateFromAppConfig,
getConfigData,
}
2026-08-01 10:11:28 +03:30
})