// Watch subscribe to a certain event with a callback.
Watch subscribe to a certain event with a callback.
// Watch subscribe to a certain event with a callback .
func (b *bus) Watch(event string, callback Callback) {
	var callbacks []Callback
	if actual, ok := b.callbacks.Load(event); ok {
		callbacks = append(callbacks, actual.([]Callback)...)
	}
	callbacks = append(callbacks, callback)
	b.callbacks.Store(event, callbacks)
}
func ( b * bus ) Watch ( event string , callback Callback ) { var callbacks [ ] Callback if actual , ok := b . callbacks . Load ( event ) ; ok { callbacks = append ( callbacks , actual . ( [ ] Callback ) ... ) } callbacks = append ( callbacks , callback ) b . callbacks . Store ( event , callbacks ) }
Watch subscribe to a certain event with a callback.
Watch subscribe to a certain event with a callback .