all repos — kōi @ 6552cde48bf0f293b876864af2aff29c013e24f5

Minimalist task manager

src/lib/db.ts (view raw)

 1import Dexie, { type EntityTable } from 'dexie'
 2
 3export const db = new Dexie('tasks') as Dexie & {
 4    tasks: EntityTable<Task, 'id'>
 5}
 6
 7db.version(1).stores({
 8  tasks: '++id, content, done, dueDate'
 9})
10
11db.open().catch(err => {
12  console.error('Failed to open db: ' + err.stack)
13})