🪇 Implements major structure and service refactors

This commit is contained in:
Rune Harlyk
2024-08-19 20:13:57 +02:00
committed by Rune Harlyk
parent 9978918bf9
commit 3da1717341
23 changed files with 139 additions and 121 deletions
+17
View File
@@ -0,0 +1,17 @@
import { api } from '$lib/api';
import { notifications } from '$lib/components/toasts/notifications';
import { onMount } from 'svelte';
import { writable } from 'svelte/store';
export function useFeatureFlags() {
const featureFlags = writable<Record<string, boolean>>({});
onMount(async () => {
const result = await api.get<Record<string, boolean>>('/api/features');
if (result.isOk()) featureFlags.set(result.inner);
else {
notifications.error('Feature flag could not fetched', 2500);
}
});
return featureFlags;
}