refactor: improve app startup perf many times

This commit is contained in:
thecodrr
2021-10-23 10:58:44 +05:00
parent 98998e27a4
commit 45d33d90f6
66 changed files with 1120 additions and 784 deletions

View File

@@ -0,0 +1,16 @@
import { useEffect, useState } from "react";
import { initializeDatabase } from "../common/db";
export default function useDatabase() {
const [isAppLoaded, setIsAppLoaded] = useState(false);
useEffect(() => {
(async () => {
await import("../app.css");
await initializeDatabase();
setIsAppLoaded(true);
})();
}, []);
return [isAppLoaded];
}