@live-change/db-store-indexeddb 0.7.0 → 0.7.3
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/index.js +2 -1
- package/lib/Store.js +9 -6
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import Store from './lib/Store.js'
|
|
2
|
+
export default Store
|
package/lib/Store.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import IntervalTreeLib from '@live-change/interval-tree'
|
|
2
|
+
const IntervalTree = IntervalTreeLib.default ?? IntervalTreeLib
|
|
3
|
+
import ReactiveDao from "@live-change/dao"
|
|
4
|
+
import { BroadcastChannel, createLeaderElection } from 'broadcast-channel'
|
|
6
5
|
|
|
7
6
|
class ObjectObservable extends ReactiveDao.ObservableValue {
|
|
8
7
|
constructor(store, key) {
|
|
@@ -349,6 +348,10 @@ class Store {
|
|
|
349
348
|
this.rangeObservablesTree = new IntervalTree()
|
|
350
349
|
}
|
|
351
350
|
|
|
351
|
+
clear() {
|
|
352
|
+
globalThis.indexedDB.deleteDatabase(this.idbName)
|
|
353
|
+
}
|
|
354
|
+
|
|
352
355
|
async openDb() {
|
|
353
356
|
console.log("Opening db", this.dbName, this.storeName)
|
|
354
357
|
const openRequest = globalThis.indexedDB.open(this.idbName, 1)
|
|
@@ -682,4 +685,4 @@ class Store {
|
|
|
682
685
|
|
|
683
686
|
}
|
|
684
687
|
|
|
685
|
-
|
|
688
|
+
export default Store
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/db-store-indexeddb",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"description": "Database with observable data for live queries",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"tape": "^5.7.4"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@live-change/dao": "0.
|
|
29
|
+
"@live-change/dao": "0.6.0",
|
|
30
30
|
"@live-change/interval-tree": "^1.0.12",
|
|
31
31
|
"broadcast-channel": "^4.2.0"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "447f57db32c3b49d53a76ea3f94d725c25ae2791"
|
|
34
34
|
}
|