gg_observable

package
v0.2.107 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

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{})

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL