mirror of
https://github.com/jnsahaj/tweakcn.git
synced 2026-08-30 18:10:28 +08:00
f0c37392ac
* setup drizzle with better-auth * switch to turso * chore: better auth migrations * feat: add basic signin signup auth * update form uis * remove emailAndPassword * loading state for auth btns * add theme routes and save function * migrate to actions * feat: Add dashboard page to view saved themes * hook up delete theme functionality * minor improvements * feat(auth): add AuthDialogWrapper and integrate with existing components * setup post login action to open save modal after login * refactor action bar * refactor * add ability to open theme by id * Use URL param for themeId * feat(editor): improve theme loading and add theme editing actions component * feat(theme): implement theme editing functionality with routing updates * refactor: move to try-catch * remove unused files for auth and theme routes * fix build errors * modify copies * add theme limit
9 lines
212 B
TypeScript
9 lines
212 B
TypeScript
export async function tryCatch<T, E = Error>(promise: T | Promise<T>) {
|
|
try {
|
|
const data = await promise;
|
|
return [null, data] as const;
|
|
} catch (error) {
|
|
return [error as E, null] as const;
|
|
}
|
|
}
|