add plugin hook for config

This commit is contained in:
Dax Raad
2025-08-21 11:22:13 -04:00
parent a9dcbedf99
commit 4518f96e3d
3 changed files with 9 additions and 2 deletions

View File

@@ -8,9 +8,9 @@ import { Snapshot } from "../snapshot"
export async function bootstrap<T>(input: App.Input, cb: (app: App.Info) => Promise<T>) {
return App.provide(input, async (app) => {
await Plugin.init()
Share.init()
Format.init()
Plugin.init()
ConfigHooks.init()
LSP.init()
Snapshot.init()

View File

@@ -68,7 +68,12 @@ export namespace Plugin {
return state().then((x) => x.hooks)
}
export function init() {
export async function init() {
const hooks = await state().then((x) => x.hooks)
const config = await Config.get()
for (const hook of hooks) {
hook.config?.(config)
}
Bus.subscribeAll(async (input) => {
const hooks = await state().then((x) => x.hooks)
for (const hook of hooks) {