http api set_config now grants that changes are applied after returning
Massimo Melina committed
Feb 12, 2026 at 14:43 UTC
47c8cf45cdad9362f3bc6219e5c67b5f2b2c13a1
1 file changed
+2
-2
src/config.ts
+2
-2
@@ -75,7 +75,7 @@ export function defineConfig<T, CT=unknown>(k: string, defaultValue: T, compiler
75
return events.on(CONFIG_CHANGE_EVENT_PREFIX + k, (v, was, version, onlyCompileChanged) => {
76
if (stack.includes(cb)) return // avoid infinite loop in case a subscriber changes the value
77
stack.push(cb)
78
- try { cb(v, { k, was, version, defaultValue, object, onlyCompileChanged }) }
78
+ try { return cb(v, { k, was, version, defaultValue, object, onlyCompileChanged }) }
79
finally { stack.pop() }
80
}, { warnAfter: 1000 }) // e.g. each plugin watch enable_plugins
81
},
@@ -96,7 +96,7 @@ export function defineConfig<T, CT=unknown>(k: string, defaultValue: T, compiler
96
if (compiler)
97
object.sub((v, more) => {
98
if (!more.onlyCompileChanged)
99
- compiled = compiler(v, more)
99
+ return compiled = compiler(v, more)
100
})
101
return object
102
}