Comparing version 0.0.20 to 0.0.21
@@ -1,2 +0,1 @@ | ||
import { LinkedAbortController } from 'linked-abort-controller'; | ||
import { Class } from 'yummies/utils/types'; | ||
@@ -9,3 +8,2 @@ import { ContainerConfig } from './container.types.js'; | ||
protected id: string; | ||
protected abortController: LinkedAbortController; | ||
protected dependencies: Map<Tag<any>, any>; | ||
@@ -12,0 +10,0 @@ protected children: Container[]; |
@@ -1,4 +0,1 @@ | ||
/* eslint-disable no-prototype-builtins */ | ||
/* eslint-disable @typescript-eslint/no-use-before-define */ | ||
import { LinkedAbortController } from 'linked-abort-controller'; | ||
import { Tag } from './tag.js'; | ||
@@ -9,3 +6,2 @@ const mark = Symbol('di-container'); | ||
id; | ||
abortController; | ||
dependencies; | ||
@@ -22,9 +18,5 @@ children; | ||
this.id = config?.id ?? config?.generateId?.() ?? crypto.randomUUID(); | ||
this.abortController = new LinkedAbortController(config?.abortSignal); | ||
this.dependencies = new Map(); | ||
this.parent = config?.parent; | ||
this.children = []; | ||
this.abortController.signal.addEventListener('abort', () => { | ||
this.destroy(); | ||
}); | ||
} | ||
@@ -115,3 +107,2 @@ inject(Constructor, ...args) { | ||
container.path = this.path; | ||
container.abortController.link(this.abortController.signal); | ||
this.children.push(container); | ||
@@ -118,0 +109,0 @@ return container; |
{ | ||
"name": "mobidic", | ||
"version": "0.0.20", | ||
"version": "0.0.21", | ||
"keywords": [], | ||
@@ -5,0 +5,0 @@ "author": "js2me", |
Sorry, the diff of this file is not supported yet
32388
608