Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Observable ¶
type Observable interface { // AddObserver adds a new callback to an observable value. AddObserver(observer func(data interface{})) ObserverManager // Notify executes all callbacks with provided data. Notify(data interface{}) }
Observable allows one to attach an callback which will be called when someone calls the Notify method. It might be for example a change of some property's value.
func NewObservable ¶
func NewObservable() Observable
NewObservable creates an default instance of the Observable type.
func NewThreadSafeObservable ¶
func NewThreadSafeObservable() Observable
NewThreadSafeObservable creates an instance of the Observable type that can be used safely by multiple go-routines.
type ObserverManager ¶
type ObserverManager interface {
// RemoveObserver removes underlying callback from its Observable value.
RemoveObserver()
}
ObserverManager allows one to remove its callback from its underlying Observable instance.
Click to show internal directories.
Click to hide internal directories.