Skip to content
Source
Sign inSign up
TanStack/db
Open History to see the last commit

app-local-storage.js

11 lines312 Bytes

1// The typical app, plus a collection persisted to localStorage.
2import { createCollection, localStorageCollectionOptions } from '@tanstack/db'
3​
4export * from './app.js'
5​
6export const drafts = createCollection(
7 localStorageCollectionOptions({
8 storageKey: `drafts`,
9 getKey: (draft) => draft.id,
10 }),