Documentation ¶
Index ¶
- type ObservableHelper
- type ObservableObj
- func (instance *ObservableObj) Fork() *ObservableObj
- func (instance *ObservableObj) Get(key string) (value interface{})
- func (instance *ObservableObj) IsAsync() bool
- func (instance *ObservableObj) Map() map[string]interface{}
- func (instance *ObservableObj) Observe(key string, callback ObserverCallback) *ObservableObj
- func (instance *ObservableObj) Set(key string, value interface{}) *ObservableObj
- func (instance *ObservableObj) SetAsync(value bool) *ObservableObj
- func (instance *ObservableObj) SetKeepOrder(value bool) *ObservableObj
- func (instance *ObservableObj) String() string
- func (instance *ObservableObj) Wait()
- type ObserverCallback
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ObservableHelper ¶
type ObservableHelper struct { }
var Observable *ObservableHelper
func (ObservableHelper) New ¶
func (instance ObservableHelper) New() *ObservableObj
type ObservableObj ¶
type ObservableObj struct {
// contains filtered or unexported fields
}
ObservableObj preserve values into a map and notify to observers any change
func NewObservable ¶
func NewObservable() *ObservableObj
func (*ObservableObj) Fork ¶
func (instance *ObservableObj) Fork() *ObservableObj
Fork clone data but not observers
func (*ObservableObj) Get ¶
func (instance *ObservableObj) Get(key string) (value interface{})
func (*ObservableObj) IsAsync ¶
func (instance *ObservableObj) IsAsync() bool
func (*ObservableObj) Map ¶ added in v0.2.61
func (instance *ObservableObj) Map() map[string]interface{}
func (*ObservableObj) Observe ¶
func (instance *ObservableObj) Observe(key string, callback ObserverCallback) *ObservableObj
func (*ObservableObj) Set ¶
func (instance *ObservableObj) Set(key string, value interface{}) *ObservableObj
func (*ObservableObj) SetAsync ¶
func (instance *ObservableObj) SetAsync(value bool) *ObservableObj
SetAsync enable async notifications, but do not give any warranty about execution order
func (*ObservableObj) SetKeepOrder ¶
func (instance *ObservableObj) SetKeepOrder(value bool) *ObservableObj
SetKeepOrder ensure FIFO execution order in notification
func (*ObservableObj) String ¶
func (instance *ObservableObj) String() string
func (*ObservableObj) Wait ¶
func (instance *ObservableObj) Wait()
type ObserverCallback ¶
type ObserverCallback func(sender *ObservableObj, key string, newValue, oldValue interface{})
Click to show internal directories.
Click to hide internal directories.