Bluesky app fork with some witchin' additions 馃挮
at main 40 lines 1.1 kB view raw
1const SECOND = 1e3 2const MINUTE = SECOND * 60 3const HOUR = MINUTE * 60 4 5export const STALE = { 6 SECONDS: { 7 FIFTEEN: 15 * SECOND, 8 THIRTY: 30 * SECOND, 9 }, 10 MINUTES: { 11 ONE: MINUTE, 12 THREE: 3 * MINUTE, 13 FIVE: 5 * MINUTE, 14 THIRTY: 30 * MINUTE, 15 }, 16 HOURS: { 17 ONE: HOUR, 18 }, 19 INFINITY: Infinity, 20} 21 22/** 23 * Root key for persisted queries. 24 * 25 * If the `querykey` of your query uses this at index 0, it will be 26 * persisted automatically by the `PersistQueryClientProvider` in 27 * `#/lib/react-query.tsx`. 28 * 29 * Be careful when using this, since it will change the query key and may 30 * break any cases where we call `invalidateQueries` or `refetchQueries` 31 * with the old key. 32 * 33 * Also, only use this for queries that are safe to persist between 34 * app launches (like user preferences). 35 * 36 * Note that for queries that are persisted, it is recommended to extend 37 * the `gcTime` to a longer duration, otherwise it'll get busted 38 */ 39export const PERSISTED_QUERY_ROOT = 'PERSISTED' 40export const PERSISTED_QUERY_GCTIME = Infinity