* Run every hook that hasn't been applied to the current config yet. * Hooks added after `Config.create()` (e.g. from plugin boot code) stay * pending until this is called; once it runs, they're marked applied so * subsequent calls are no-ops. Hooks added while pending hooks are running
(cfg = config)
| 161 | * @return {boolean} true if any hook ran |
| 162 | */ |
| 163 | static runPendingHooks(cfg = config) { |
| 164 | let ran = false |
| 165 | for (const hook of hooks) { |
| 166 | if (hook.ran) continue |
| 167 | applyHook(hook, cfg) |
| 168 | ran = true |
| 169 | } |
| 170 | return ran |
| 171 | } |
| 172 | |
| 173 | /** |
| 174 | * Number of registered config hooks. Useful for snapshotting before a phase |