* Applies one or more mixins to this construct. * * Mixins are applied in order. The list of constructs is captured at the * start of the call, so constructs added by a mixin will not be visited. * Use multiple `with()` calls if subsequent mixins should apply to added * constructs.
(...mixins: IMixin[])
| 491 | * @returns This construct for chaining |
| 492 | */ |
| 493 | public with(...mixins: IMixin[]): IConstruct { |
| 494 | const allConstructs = this.findAll(); |
| 495 | for (const mixin of mixins) { |
| 496 | for (const construct of allConstructs) { |
| 497 | if (mixin.supports(construct)) { |
| 498 | mixin.applyTo(construct); |
| 499 | } |
| 500 | } |
| 501 | } |
| 502 | return this.host; |
| 503 | }; |
| 504 | |
| 505 | /** |
| 506 | * Adds a child construct to this node. |