mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-01-16 00:33:27 +01:00
12 lines
329 B
TypeScript
12 lines
329 B
TypeScript
import type { Settings } from '@yaakapp/api';
|
|
import { useAtomValue } from 'jotai';
|
|
import { atom } from 'jotai/index';
|
|
import { getSettings } from '../lib/store';
|
|
|
|
const settings = await getSettings();
|
|
export const settingsAtom = atom<Settings>(settings);
|
|
|
|
export function useSettings() {
|
|
return useAtomValue(settingsAtom);
|
|
}
|