@vercube/di 0.0.2-beta.0 → 0.0.2-beta.1

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/dist/index.cjs CHANGED
@@ -422,7 +422,10 @@ var Container = class Container {
422
422
  };
423
423
  if (typeof key === "symbol" && !value) throw new Error("Container - provide implementation for binds with symbols.");
424
424
  const existingServiceDef = this.fServices.get(key);
425
- if (existingServiceDef) this.internalDispose(existingServiceDef);
425
+ if (existingServiceDef) {
426
+ this.internalDispose(existingServiceDef);
427
+ this.fServices.delete(key);
428
+ }
426
429
  this.fServices.set(key, newDef);
427
430
  this.fNewQueue.set(key, newDef);
428
431
  }
@@ -664,7 +667,10 @@ var Container = class Container {
664
667
  }
665
668
  case IOC.ServiceFactoryType.CLASS_SINGLETON: {
666
669
  const existingInstance = this.fSingletonInstances.get(def.serviceKey);
667
- if (existingInstance) destroyDecorators(existingInstance, this);
670
+ if (existingInstance) {
671
+ destroyDecorators(existingInstance, this);
672
+ this.fSingletonInstances.delete(def.serviceKey);
673
+ }
668
674
  break;
669
675
  }
670
676
  case IOC.ServiceFactoryType.CLASS: break;
package/dist/index.mjs CHANGED
@@ -420,7 +420,10 @@ var Container = class Container {
420
420
  };
421
421
  if (typeof key === "symbol" && !value) throw new Error("Container - provide implementation for binds with symbols.");
422
422
  const existingServiceDef = this.fServices.get(key);
423
- if (existingServiceDef) this.internalDispose(existingServiceDef);
423
+ if (existingServiceDef) {
424
+ this.internalDispose(existingServiceDef);
425
+ this.fServices.delete(key);
426
+ }
424
427
  this.fServices.set(key, newDef);
425
428
  this.fNewQueue.set(key, newDef);
426
429
  }
@@ -662,7 +665,10 @@ var Container = class Container {
662
665
  }
663
666
  case IOC.ServiceFactoryType.CLASS_SINGLETON: {
664
667
  const existingInstance = this.fSingletonInstances.get(def.serviceKey);
665
- if (existingInstance) destroyDecorators(existingInstance, this);
668
+ if (existingInstance) {
669
+ destroyDecorators(existingInstance, this);
670
+ this.fSingletonInstances.delete(def.serviceKey);
671
+ }
666
672
  break;
667
673
  }
668
674
  case IOC.ServiceFactoryType.CLASS: break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercube/di",
3
- "version": "0.0.2-beta.0",
3
+ "version": "0.0.2-beta.1",
4
4
  "description": "Dependencie Injection module for Vercube framework",
5
5
  "repository": "@vercube/di",
6
6
  "license": "MIT",