add and use event bus for UI progress

This commit is contained in:
Alex Goodman
2020-06-25 10:39:11 -04:00
parent 2e9e969c5f
commit 926b5f2a50
24 changed files with 725 additions and 96 deletions
+19
View File
@@ -0,0 +1,19 @@
package bus
import "github.com/wagoodman/go-partybus"
var publisher partybus.Publisher
var active bool
func SetPublisher(p partybus.Publisher) {
publisher = p
if p != nil {
active = true
}
}
func Publish(event partybus.Event) {
if active {
publisher.Publish(event)
}
}