finished pruning for lit-only demo

This commit is contained in:
authentik Default Admin 2026-03-04 14:18:44 -08:00
parent 648412dd6d
commit 3736d7278b
10 changed files with 217 additions and 281 deletions

View file

@ -1,33 +0,0 @@
// lib/idb.js
import { createStore, get, set, del, entries, clear } from 'idb-keyval'
// Named stores — each maps to a distinct IDBObjectStore
export const itemsStore = createStore('app-db', 'items')
export const userStore = createStore('app-db', 'user')
export const cacheStore = createStore('app-db', 'cache')
// Typed wrappers — keeps raw idb-keyval calls out of the rest of the app
// and gives you one place to add validation, logging, or migration logic
export const db = {
items: {
getAll: () => entries(itemsStore),
get: (id) => get(id, itemsStore),
set: (id, value) => set(id, value, itemsStore),
remove: (id) => del(id, itemsStore),
clear: () => clear(itemsStore),
},
user: {
get: () => get('user', userStore),
set: (value) => set('user', value, userStore),
clear: () => del('user', userStore),
},
cache: {
get: (key) => get(key, cacheStore),
set: (key, value) => set(key, value, cacheStore),
remove: (key) => del(key, cacheStore),
clear: () => clear(cacheStore),
}
}