server.watcher.on('change', debounce(async () => {
+ await (app.onClose?.() ?? Promise.resolve())
await _loadApp(config);
}, debounceDelayMs));
would be nice to have this. simple and non invasive. if the app exposes a onClose method, it's called an awaited to allow destruction before reload. helps to sever persistent connections to 3rd party services.