diff --git a/README.md b/README.md index 77c3a4d7..06a757f2 100644 --- a/README.md +++ b/README.md @@ -67,12 +67,18 @@ configuration source(s). They read configuration in terms of functions in packag ``` func (app *appObject) Run() { + // Read the server configuration. type serverConfig struct { Host string Port int } cfg := konf.Get[serverConfig]("server") + // Register callbacks while server configuration changes. + konf.OnChange(func() { + // Reconfig the application object. + }, "server") + // ... use cfg in app code ... } ```