forked from imbytecat/fullstack-starter
refactor: 抽取 UI 组件、改进错误页面、统一导入路径并简化数据库接口
This commit is contained in:
@@ -13,11 +13,7 @@ export type DB = ReturnType<typeof createDB>
|
||||
export const getDB = (() => {
|
||||
let db: DB | null = null
|
||||
|
||||
return (singleton = true): DB => {
|
||||
if (!singleton) {
|
||||
return createDB()
|
||||
}
|
||||
|
||||
return (): DB => {
|
||||
db ??= createDB()
|
||||
return db
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user