Explicitly set the request layout (#257)

This commit is contained in:
Gregory Schier
2025-09-25 07:23:52 -07:00
committed by GitHub
parent 73ad86c6b9
commit df15543c80
8 changed files with 41 additions and 16 deletions

View File

@@ -1,6 +1,8 @@
import deepEqual from '@gilbarbara/deep-equal';
import type { Atom } from 'jotai';
import { selectAtom } from 'jotai/utils';
import type { SplitLayoutLayout } from '../components/core/SplitLayout';
import { atomWithKVStorage } from './atoms/atomWithKVStorage';
export function deepEqualAtom<T>(a: Atom<T>) {
return selectAtom(
@@ -9,3 +11,8 @@ export function deepEqualAtom<T>(a: Atom<T>) {
(a, b) => deepEqual(a, b),
);
}
export const workspaceLayoutAtom = atomWithKVStorage<SplitLayoutLayout>(
'workspace_layout',
'horizontal',
);