| 22 | * construct tree needs to be combined to be used as a single dependable. |
| 23 | */ |
| 24 | export class DependencyGroup implements IDependable { |
| 25 | private readonly _deps = new Array<IDependable>(); |
| 26 | |
| 27 | constructor(...deps: IDependable[]) { |
| 28 | const self = this; |
| 29 | |
| 30 | Dependable.implement(this, { |
| 31 | get dependencyRoots() { |
| 32 | const result = new Array<IConstruct>(); |
| 33 | for (const d of self._deps) { |
| 34 | result.push(...Dependable.of(d).dependencyRoots); |
| 35 | } |
| 36 | return result; |
| 37 | }, |
| 38 | }); |
| 39 | |
| 40 | this.add(...deps); |
| 41 | } |
| 42 | |
| 43 | /** |
| 44 | * Add a construct to the dependency roots |
| 45 | */ |
| 46 | public add(...scopes: IDependable[]) { |
| 47 | this._deps.push(...scopes); |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | const DEPENDABLE_SYMBOL = Symbol.for('@aws-cdk/core.DependableTrait'); |
| 52 |
nothing calls this directly
no outgoing calls
no test coverage detected