()
| 85 | } |
| 86 | |
| 87 | export async function init() { |
| 88 | const hooks = await state().then((x) => x.hooks) |
| 89 | const config = await Config.get() |
| 90 | for (const hook of hooks) { |
| 91 | await hook.config?.(config) |
| 92 | } |
| 93 | Bus.subscribeAll(async (input) => { |
| 94 | const hooks = await state().then((x) => x.hooks) |
| 95 | for (const hook of hooks) { |
| 96 | hook["event"]?.({ |
| 97 | event: input, |
| 98 | }) |
| 99 | } |
| 100 | }) |
| 101 | } |
| 102 | } |