Documentation ¶
Index ¶
- func DropRet[T, R any](f func(T) R) func(T)
- func EmptyValue[V any]() V
- func ObserveChange[Src ObservableValue[T], T any](src Src, cb func(T, T))
- func ObserveInvalidation[Src Observable](src Src, cb func())
- func ObserveValue[Src ObservableValue[T], T any](src Src, cb func(T))
- type Binding
- func Bind[Src ObservableValue[T], T, V any](src Src, mapper func(T) V) Binding[V]
- func BindAny[V any](src RawObservableValue, mapper func(any) V) Binding[V]
- func BindFunc[Src ObservableValue[T], T any](f func(T), src Src) Binding[T]
- func Select[Src ObservableValue[V], V, Result ObservableValue[T], T any](src Src, mapper func(V) Result) Binding[T]
- type BoolProperty
- type ChangeListener
- type DoubleProperty
- type ExpressionBinding
- type ExpressionHelper
- type FloatProperty
- type HasListenersBase
- type IProperty
- type IntProperty
- type Invalidatable
- type InvalidationListener
- type ObjectBinding
- func (b *ObjectBinding[T, V]) Close()
- func (b *ObjectBinding[T, V]) Dependencies() []Observable
- func (b *ObjectBinding[T, V]) Invalidate()
- func (b *ObjectBinding[T, V]) IsValid() bool
- func (b *ObjectBinding[T, V]) OnInvalidated(prop Observable)
- func (o *ObjectBinding[T, V]) RawValue() any
- func (b *ObjectBinding[T, V]) Value() V
- type Observable
- type ObservableValue
- type ObservableValueBase
- func (o *ObservableValueBase[T]) AddChangeListener(listener ChangeListener[T])
- func (o *ObservableValueBase[T]) AddListener(listener InvalidationListener)
- func (o *ObservableValueBase[T]) OnInvalidated(obs Observable)
- func (o *ObservableValueBase[T]) RemoveChangeListener(listener ChangeListener[T])
- func (o *ObservableValueBase[T]) RemoveListener(listener InvalidationListener)
- type OnChangedFunc
- type OnInvalidatedFunc
- type Property
- type RawObservableValue
- type ReadOnlyProperty
- type SelectBinding
- type SelectStep
- type SimpleProperty
- func (o *SimpleProperty[T]) AddChangeListener(listener ChangeListener[T])
- func (o *SimpleProperty[T]) AddListener(listener InvalidationListener)
- func (o *SimpleProperty[T]) Bind(observable ObservableValue[T])
- func (o *SimpleProperty[T]) BindBidirectional(other Property[T])
- func (o *SimpleProperty[T]) Close()
- func (o *SimpleProperty[T]) IsBound() bool
- func (o *SimpleProperty[T]) Property() IProperty
- func (o *SimpleProperty[T]) RawValue() any
- func (o *SimpleProperty[T]) RemoveChangeListener(listener ChangeListener[T])
- func (o *SimpleProperty[T]) RemoveListener(listener InvalidationListener)
- func (o *SimpleProperty[T]) SetValue(value T)
- func (o *SimpleProperty[T]) Unbind()
- func (o *SimpleProperty[T]) UnbindBidirectional()
- func (o *SimpleProperty[T]) Value() T
- type StringProperty
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EmptyValue ¶
func EmptyValue[V any]() V
func ObserveChange ¶
func ObserveChange[Src ObservableValue[T], T any](src Src, cb func(T, T))
func ObserveInvalidation ¶
func ObserveInvalidation[Src Observable](src Src, cb func())
func ObserveValue ¶
func ObserveValue[Src ObservableValue[T], T any](src Src, cb func(T))
Types ¶
type Binding ¶
type Binding[V any] interface { ObservableValue[V] Dependencies() []Observable Invalidate() IsValid() bool Close() }
func Bind ¶
func Bind[Src ObservableValue[T], T, V any](src Src, mapper func(T) V) Binding[V]
func BindFunc ¶
func BindFunc[Src ObservableValue[T], T any](f func(T), src Src) Binding[T]
func Select ¶
func Select[Src ObservableValue[V], V, Result ObservableValue[T], T any](src Src, mapper func(V) Result) Binding[T]
type BoolProperty ¶
type BoolProperty = SimpleProperty[bool]
type ChangeListener ¶
type ChangeListener[T any] interface { OnChanged(observable ObservableValue[T], old, current T) }
type DoubleProperty ¶
type DoubleProperty = SimpleProperty[float64]
type ExpressionBinding ¶
type ExpressionBinding[V any] struct { ObservableValueBase[V] // contains filtered or unexported fields }
func BindExpression ¶
func BindExpression[V any](fn func() V, deps ...Observable) *ExpressionBinding[V]
func (*ExpressionBinding[V]) Invalidate ¶
func (e *ExpressionBinding[V]) Invalidate()
func (*ExpressionBinding[V]) RawValue ¶
func (e *ExpressionBinding[V]) RawValue() any
func (*ExpressionBinding[V]) Value ¶
func (e *ExpressionBinding[V]) Value() V
type ExpressionHelper ¶
type ExpressionHelper[T any] interface { InvalidationListener AddListener(listener InvalidationListener) ExpressionHelper[T] RemoveListener(listener InvalidationListener) ExpressionHelper[T] AddChangeListener(listener ChangeListener[T]) ExpressionHelper[T] RemoveChangeListener(listener ChangeListener[T]) ExpressionHelper[T] }
func NewSingleChangeListenerExpressionHelper ¶
func NewSingleChangeListenerExpressionHelper[T any](listener ChangeListener[T]) ExpressionHelper[T]
func NewSingleInvalidationExpressionHelper ¶
func NewSingleInvalidationExpressionHelper[T any](listener InvalidationListener) ExpressionHelper[T]
type FloatProperty ¶
type FloatProperty = SimpleProperty[float32]
type HasListenersBase ¶
type HasListenersBase[T any] struct { // contains filtered or unexported fields }
func (*HasListenersBase[T]) AddListener ¶
func (o *HasListenersBase[T]) AddListener(listener T)
func (*HasListenersBase[T]) Close ¶
func (o *HasListenersBase[T]) Close()
func (*HasListenersBase[T]) ForEachListener ¶
func (o *HasListenersBase[T]) ForEachListener(do func(l T) bool)
func (*HasListenersBase[T]) RemoveListener ¶
func (o *HasListenersBase[T]) RemoveListener(listener T)
type IntProperty ¶
type IntProperty = SimpleProperty[int]
type Invalidatable ¶
type Invalidatable interface {
Invalidate()
}
type InvalidationListener ¶
type InvalidationListener interface {
OnInvalidated(observable Observable)
}
type ObjectBinding ¶
type ObjectBinding[T, V any] struct { ObservableValueBase[V] // contains filtered or unexported fields }
func NewObjectBinding ¶
func NewObjectBinding[T, V any](src ObservableValue[T], mapper func(T) V) *ObjectBinding[T, V]
func (*ObjectBinding[T, V]) Close ¶
func (b *ObjectBinding[T, V]) Close()
func (*ObjectBinding[T, V]) Dependencies ¶
func (b *ObjectBinding[T, V]) Dependencies() []Observable
func (*ObjectBinding[T, V]) Invalidate ¶
func (b *ObjectBinding[T, V]) Invalidate()
func (*ObjectBinding[T, V]) IsValid ¶
func (b *ObjectBinding[T, V]) IsValid() bool
func (*ObjectBinding[T, V]) OnInvalidated ¶
func (b *ObjectBinding[T, V]) OnInvalidated(prop Observable)
func (*ObjectBinding[T, V]) RawValue ¶
func (o *ObjectBinding[T, V]) RawValue() any
func (*ObjectBinding[T, V]) Value ¶
func (b *ObjectBinding[T, V]) Value() V
type Observable ¶
type Observable interface { AddListener(listener InvalidationListener) RemoveListener(listener InvalidationListener) }
type ObservableValue ¶
type ObservableValue[T any] interface { RawObservableValue Value() T AddChangeListener(listener ChangeListener[T]) RemoveChangeListener(listener ChangeListener[T]) }
func Just ¶
func Just[V any](v V) ObservableValue[V]
type ObservableValueBase ¶
type ObservableValueBase[T any] struct { // contains filtered or unexported fields }
func (*ObservableValueBase[T]) AddChangeListener ¶
func (o *ObservableValueBase[T]) AddChangeListener(listener ChangeListener[T])
func (*ObservableValueBase[T]) AddListener ¶
func (o *ObservableValueBase[T]) AddListener(listener InvalidationListener)
func (*ObservableValueBase[T]) OnInvalidated ¶
func (o *ObservableValueBase[T]) OnInvalidated(obs Observable)
func (*ObservableValueBase[T]) RemoveChangeListener ¶
func (o *ObservableValueBase[T]) RemoveChangeListener(listener ChangeListener[T])
func (*ObservableValueBase[T]) RemoveListener ¶
func (o *ObservableValueBase[T]) RemoveListener(listener InvalidationListener)
type OnChangedFunc ¶
type OnChangedFunc[T any] func(prop ObservableValue[T], old, current T)
func (OnChangedFunc[T]) OnChanged ¶
func (o OnChangedFunc[T]) OnChanged(prop ObservableValue[T], old, current T)
type OnInvalidatedFunc ¶
type OnInvalidatedFunc func(src Observable)
func (OnInvalidatedFunc) OnInvalidated ¶
func (o OnInvalidatedFunc) OnInvalidated(src Observable)
type Property ¶
type Property[T any] interface { IProperty ReadOnlyProperty[T] IsBound() bool Bind(observable ObservableValue[T]) Unbind() BindBidirectional(other Property[T]) UnbindBidirectional() SetValue(value T) }
type RawObservableValue ¶
type RawObservableValue interface { Observable RawValue() any }
type ReadOnlyProperty ¶
type ReadOnlyProperty[T any] interface { IProperty ObservableValue[T] }
type SelectBinding ¶
type SelectBinding[T any] struct { ObservableValueBase[T] // contains filtered or unexported fields }
func NewSelectBinding ¶
func NewSelectBinding[T any](root Observable, steps []SelectStep) *SelectBinding[T]
func (*SelectBinding[T]) Close ¶
func (s *SelectBinding[T]) Close()
func (*SelectBinding[T]) Dependencies ¶
func (s *SelectBinding[T]) Dependencies() []Observable
func (*SelectBinding[T]) Invalidate ¶
func (s *SelectBinding[T]) Invalidate()
func (*SelectBinding[T]) IsValid ¶
func (s *SelectBinding[T]) IsValid() bool
func (*SelectBinding[T]) RawValue ¶
func (o *SelectBinding[T]) RawValue() any
func (*SelectBinding[T]) Value ¶
func (s *SelectBinding[T]) Value() T
type SelectStep ¶
type SelectStep func(any) Observable
type SimpleProperty ¶
type SimpleProperty[T any] struct { // contains filtered or unexported fields }
func (*SimpleProperty[T]) AddChangeListener ¶
func (o *SimpleProperty[T]) AddChangeListener(listener ChangeListener[T])
func (*SimpleProperty[T]) AddListener ¶
func (o *SimpleProperty[T]) AddListener(listener InvalidationListener)
func (*SimpleProperty[T]) Bind ¶
func (o *SimpleProperty[T]) Bind(observable ObservableValue[T])
func (*SimpleProperty[T]) BindBidirectional ¶
func (o *SimpleProperty[T]) BindBidirectional(other Property[T])
func (*SimpleProperty[T]) Close ¶
func (o *SimpleProperty[T]) Close()
func (*SimpleProperty[T]) IsBound ¶
func (o *SimpleProperty[T]) IsBound() bool
func (*SimpleProperty[T]) Property ¶
func (o *SimpleProperty[T]) Property() IProperty
func (*SimpleProperty[T]) RawValue ¶
func (o *SimpleProperty[T]) RawValue() any
func (*SimpleProperty[T]) RemoveChangeListener ¶
func (o *SimpleProperty[T]) RemoveChangeListener(listener ChangeListener[T])
func (*SimpleProperty[T]) RemoveListener ¶
func (o *SimpleProperty[T]) RemoveListener(listener InvalidationListener)
func (*SimpleProperty[T]) SetValue ¶
func (o *SimpleProperty[T]) SetValue(value T)
func (*SimpleProperty[T]) Unbind ¶
func (o *SimpleProperty[T]) Unbind()
func (*SimpleProperty[T]) UnbindBidirectional ¶
func (o *SimpleProperty[T]) UnbindBidirectional()
func (*SimpleProperty[T]) Value ¶
func (o *SimpleProperty[T]) Value() T
type StringProperty ¶
type StringProperty = SimpleProperty[string]
Source Files ¶
Click to show internal directories.
Click to hide internal directories.