corestore 7.0.21 → 7.0.23

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.
Files changed (2) hide show
  1. package/index.js +4 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -229,7 +229,7 @@ class Corestore extends ReadyResource {
229
229
  super()
230
230
 
231
231
  this.root = opts.root || null
232
- this.storage = this.root ? this.root.storage : Hypercore.defaultStorage(storage)
232
+ this.storage = this.root ? this.root.storage : Hypercore.defaultStorage(storage, { id: opts.id })
233
233
  this.streamTracker = this.root ? this.root.streamTracker : new StreamTracker()
234
234
  this.cores = this.root ? this.root.cores : new CoreTracker()
235
235
  this.sessions = new SessionTracker()
@@ -287,8 +287,9 @@ class Corestore extends ReadyResource {
287
287
  return auditStore(this, opts)
288
288
  }
289
289
 
290
- suspend () {
291
- return this.storage.db.suspend()
290
+ async suspend () {
291
+ await this.storage.db.flush()
292
+ await this.storage.db.suspend()
292
293
  }
293
294
 
294
295
  resume () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "corestore",
3
- "version": "7.0.21",
3
+ "version": "7.0.23",
4
4
  "description": "A Hypercore factory that simplifies managing collections of cores.",
5
5
  "main": "index.js",
6
6
  "files": [