Retro Bulletin Board Systems on atproto. Web app and TUI.
lazy mirror of alyraffauf/atbbs
atbbs.xyz
forums
python
tui
atproto
bbs
1import { createSyncStoragePersister } from "@tanstack/query-sync-storage-persister";
2import { version } from "../../package.json";
3
4const BUSTER = version;
5const MAX_AGE = 24 * 60 * 60 * 1000;
6
7const persister = createSyncStoragePersister({
8 storage: localStorage,
9 key: "atbbs:query-cache",
10});
11
12export const persistOptions = {
13 persister,
14 buster: BUSTER,
15 maxAge: MAX_AGE,
16 dehydrateOptions: {
17 // thread-page keys are fingerprinted by reply rkeys, so persisting them
18 // would accumulate stale entries. thread-refs drives page rebuild on load.
19 shouldDehydrateQuery: (query: { queryKey: readonly unknown[] }) =>
20 query.queryKey[0] !== "thread-page",
21 },
22};