mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-01-14 21:23:40 +01:00

11 lines
319 B
TypeScript
11 lines
319 B
TypeScript
import type { Workspace } from '@yaakapp/api';
|
|
import { atom, useAtomValue } from 'jotai';
|
|
import { listWorkspaces } from '../lib/store';
|
|
|
|
const workspaces = await listWorkspaces();
|
|
export const workspacesAtom = atom<Workspace[]>(workspaces);
|
|
|
|
export function useWorkspaces() {
|
|
return useAtomValue(workspacesAtom);
|
|
}
|