an appview-less Bluesky client using Constellation and PDS Queries
reddwarf.app
frontend
spa
bluesky
reddwarf
microcosm
1import type Agent from "@atproto/api";
2import { atom, createStore } from "jotai";
3import { atomWithStorage } from 'jotai/utils';
4
5export const store = createStore();
6
7export const selectedFeedUriAtom = atomWithStorage<string | null>(
8 'selectedFeedUri',
9 null
10);
11
12//export const feedScrollPositionsAtom = atom<Record<string, number>>({});
13
14export const feedScrollPositionsAtom = atomWithStorage<Record<string, number>>(
15 'feedscrollpositions',
16 {}
17);
18
19export const likedPostsAtom = atomWithStorage<Record<string, string>>(
20 'likedPosts',
21 {}
22);
23
24export const isAtTopAtom = atom<boolean>(true);
25
26type ComposerState =
27 | { kind: 'closed' }
28 | { kind: 'root' }
29 | { kind: 'reply'; parent: string }
30 | { kind: 'quote'; subject: string };
31export const composerAtom = atom<ComposerState>({ kind: 'closed' });
32
33export const agentAtom = atom<Agent|null>(null);
34export const authedAtom = atom<boolean>(false);