@live-change/db-store-localstorage 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 +10 -5
- package/lib/storage.js +1 -1
- 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,7 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
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'
|
|
5
|
+
import * as storage from './storage.js'
|
|
5
6
|
|
|
6
7
|
class ObjectObservable extends ReactiveDao.ObservableValue {
|
|
7
8
|
constructor(store, key) {
|
|
@@ -248,6 +249,10 @@ class Store {
|
|
|
248
249
|
this.rangeObservablesTree = new IntervalTree()
|
|
249
250
|
}
|
|
250
251
|
|
|
252
|
+
clear() {
|
|
253
|
+
return this.storage.clear()
|
|
254
|
+
}
|
|
255
|
+
|
|
251
256
|
async openChannel() {
|
|
252
257
|
this.channel = new BroadcastChannel(`lc-db-${this.dbName}-${this.storeName}`, {
|
|
253
258
|
idb: {
|
|
@@ -418,4 +423,4 @@ class Store {
|
|
|
418
423
|
|
|
419
424
|
}
|
|
420
425
|
|
|
421
|
-
|
|
426
|
+
export default Store
|
package/lib/storage.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/db-store-localstorage",
|
|
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
|
}
|