corestore 6.4.2 → 6.4.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.
Files changed (2) hide show
  1. package/index.js +5 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -263,12 +263,15 @@ module.exports = class Corestore extends EventEmitter {
263
263
  this._findingPeers.push(core.findingPeers())
264
264
  }
265
265
 
266
- core.once('close', () => {
266
+ const gc = () => {
267
267
  // technically better to also clear _findingPeers if we added it,
268
268
  // but the lifecycle for those are pretty short so prob not worth the complexity
269
269
  // as _decFindingPeers clear them all.
270
270
  this._sessions.delete(core)
271
- })
271
+ }
272
+
273
+ core.ready().catch(gc)
274
+ core.once('close', gc)
272
275
 
273
276
  return core
274
277
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "corestore",
3
- "version": "6.4.2",
3
+ "version": "6.4.3",
4
4
  "description": "A Hypercore factory that simplifies managing collections of cores.",
5
5
  "main": "index.js",
6
6
  "scripts": {