* Loads and configures the plugins registered with this instance. * @return Returns a promise which resolves when all plugins are loaded and configured.
()
| 494 | * @return Returns a promise which resolves when all plugins are loaded and configured. |
| 495 | */ |
| 496 | apply(): Promise<void> { |
| 497 | if (this.processed) { |
| 498 | return Promise.resolve(); |
| 499 | } |
| 500 | |
| 501 | return runTasks(this, this.preTasks).then(() => { |
| 502 | let loader = this.aurelia.loader; |
| 503 | let info = this.info; |
| 504 | let current; |
| 505 | |
| 506 | let next = () => { |
| 507 | current = info.shift(); |
| 508 | if (current) { |
| 509 | return loadPlugin(this, loader, current).then(next); |
| 510 | } |
| 511 | |
| 512 | this.processed = true; |
| 513 | this.configuredPlugins = null; |
| 514 | return Promise.resolve(); |
| 515 | }; |
| 516 | |
| 517 | return next().then(() => runTasks(this, this.postTasks)); |
| 518 | }); |
| 519 | } |
| 520 | } |
| 521 | |
| 522 | /** @internal */ |
no test coverage detected