universe-code 0.0.52 → 0.0.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/angular/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
let config = null;
|
|
2
2
|
|
|
3
3
|
export const configureIdb = (options) => {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
if (config) {
|
|
5
|
+
console.warn("IndexedDB already configured");
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
config = options;
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export const getConfig = () => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
if (!config) {
|
|
13
|
+
throw new Error(
|
|
14
|
+
"IndexedDB not configured. Call configureIdb() before using the store."
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
return config;
|
|
18
18
|
};
|
|
@@ -22,8 +22,8 @@ const connectDB = async () => {
|
|
|
22
22
|
|
|
23
23
|
export const getIdbStore = async () => {
|
|
24
24
|
if (!store) {
|
|
25
|
-
const database = await connectDB();
|
|
26
25
|
const { storeName } = getConfig(); // ✅ FIXED
|
|
26
|
+
const database = await connectDB();
|
|
27
27
|
|
|
28
28
|
store = {
|
|
29
29
|
get: (key) => DB.get(database, storeName, key),
|