Readme fix #2
This commit is contained in:
parent
f56750bf3d
commit
c7279f80d0
10
README.md
10
README.md
|
@ -36,10 +36,14 @@ Now we need to ask Secondly to take care of your configuration:
|
||||||
```go
|
```go
|
||||||
var conf Config
|
var conf Config
|
||||||
secondly.Manage(&conf)
|
secondly.Manage(&conf)
|
||||||
|
|
||||||
|
// or asynchronously
|
||||||
|
go secondly.Manage(&conf)
|
||||||
```
|
```
|
||||||
|
|
||||||
You'll probably want to know when configuration is loaded, so there's a handly
|
If you prefer to configure the app asynchronously then you'll probably want to
|
||||||
helper function just for that:
|
know when configuration is loaded, so there's a handly helper function just for
|
||||||
|
that:
|
||||||
|
|
||||||
```go
|
```go
|
||||||
secondly.OnLoad(func(){
|
secondly.OnLoad(func(){
|
||||||
|
@ -53,7 +57,7 @@ configuration of your app. But this is not what you came for, right?
|
||||||
If you want a configuration GUI, simply start Secondly's web server on a port
|
If you want a configuration GUI, simply start Secondly's web server on a port
|
||||||
you want.
|
you want.
|
||||||
|
|
||||||
```
|
```go
|
||||||
secondly.StartServer("", 5500)
|
secondly.StartServer("", 5500)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -171,6 +171,9 @@ func triggerCallbacks(oldConf, newConf interface{}) {
|
||||||
// Don't trigger callbacks on fist load
|
// Don't trigger callbacks on fist load
|
||||||
if !initialized {
|
if !initialized {
|
||||||
initialized = true
|
initialized = true
|
||||||
|
if initFunc != nil {
|
||||||
|
initFunc()
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue