-
Notifications
You must be signed in to change notification settings - Fork 306
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove typed-db, fix mangled db, close #36
- Loading branch information
1 parent
1126339
commit eafb0d5
Showing
7 changed files
with
23 additions
and
47 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
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,14 @@ | ||
import { openDB } from 'idb/with-async-ittr' | ||
/** | ||
* @deprecated | ||
* ? Webpack mangled the class name that provides to the typed-db lib. | ||
* ? So the database name is also mangled too. | ||
* ? This function is used to read out all data in the 1st version of database. | ||
*/ | ||
export async function readMangledDB(dbname: string, version: number) { | ||
const db = await openDB(dbname, version) | ||
const stores = Array.from(db.objectStoreNames) | ||
|
||
const results = await Promise.all(stores.map(storeName => db.getAll(storeName))) | ||
return results.reduce((prev, curr) => prev.concat(curr), []) | ||
} |
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