MCPcopy Create free account
hub / github.com/aws/constructs / DependencyGroup

Class DependencyGroup

src/dependency.ts:24–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22 * construct tree needs to be combined to be used as a single dependable.
23 */
24export 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
51const DEPENDABLE_SYMBOL = Symbol.for('@aws-cdk/core.DependableTrait');
52

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected