mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-26 11:21:16 +01:00
26 lines
695 B
TypeScript
26 lines
695 B
TypeScript
import deepEqual from "@gilbarbara/deep-equal";
|
|
import type { UpdateInfo } from "@yaakapp-internal/tauri-client";
|
|
import type { Atom } from "jotai";
|
|
import { 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(
|
|
a,
|
|
(v) => v,
|
|
(a, b) => deepEqual(a, b),
|
|
);
|
|
}
|
|
|
|
export const workspaceLayoutAtom = atomWithKVStorage<SplitLayoutLayout>(
|
|
"workspace_layout",
|
|
"horizontal",
|
|
);
|
|
|
|
export const updateAvailableAtom = atom<Omit<
|
|
UpdateInfo,
|
|
"replyEventId"
|
|
> | null>(null);
|