mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-19 16:21:13 +01:00
13 lines
364 B
TypeScript
13 lines
364 B
TypeScript
import type { CookieJar } from '@yaakapp-internal/models';
|
|
import { atom, useAtomValue } from 'jotai';
|
|
|
|
export const cookieJarsAtom = atom<CookieJar[] | undefined>();
|
|
|
|
export const sortedCookieJars = atom((get) =>
|
|
get(cookieJarsAtom)?.sort((a, b) => a.name.localeCompare(b.name)),
|
|
);
|
|
|
|
export function useCookieJars() {
|
|
return useAtomValue(sortedCookieJars);
|
|
}
|