@live-change/db-store-localstorage 0.7.2 → 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 CHANGED
@@ -1 +1,2 @@
1
- module.exports = require('./lib/Store.js')
1
+ import Store from './lib/Store.js'
2
+ export default Store
package/lib/Store.js CHANGED
@@ -1,7 +1,8 @@
1
- const IntervalTree = require('@live-change/interval-tree').default
2
- const ReactiveDao = require("@live-change/dao")
3
- const { BroadcastChannel, createLeaderElection } = require('broadcast-channel')
4
- const storage = require('./storage.js')
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
- module.exports = Store
426
+ export default Store
package/lib/storage.js CHANGED
@@ -158,4 +158,4 @@ if(typeof window == 'undefined') {
158
158
  }
159
159
  }
160
160
 
161
- module.exports = { local, session }
161
+ export { local, session }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/db-store-localstorage",
3
- "version": "0.7.2",
3
+ "version": "0.7.3",
4
4
  "description": "Database with observable data for live queries",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -30,5 +30,5 @@
30
30
  "@live-change/interval-tree": "^1.0.12",
31
31
  "broadcast-channel": "^4.2.0"
32
32
  },
33
- "gitHead": "36d5b8a4430d82526b8b63290c44209e6187da96"
33
+ "gitHead": "447f57db32c3b49d53a76ea3f94d725c25ae2791"
34
34
  }