-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c870a04
commit 4de763e
Showing
5 changed files
with
58 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ const colors = [ | |
"#00ffff", | ||
"#0000ff", | ||
"#800080", | ||
]; | ||
] as const; | ||
|
||
const ulStyle: any = { | ||
margin: 0, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
export const initDB = (dbName: string, dbType = 3) => { | ||
if (window.indexedDB) { | ||
// | ||
return new Promise((resolve, reject) => { | ||
const request = window.indexedDB.open(dbName, dbType); | ||
request.onerror = () => { | ||
console.error( | ||
"Why didn't you allow my web app to use IndexedDB?!" | ||
); | ||
reject(); | ||
}; | ||
request.onsuccess = (event: any) => { | ||
let db = event.target.result; | ||
resolve(db); | ||
}; | ||
}); | ||
} else { | ||
throw Error("Not Support IndexDB"); | ||
} | ||
}; |