Documentation
¶
Index ¶
- type Command
- type ContextCommand
- type EnumCommand
- type List
- func (l *List[T]) Append(v T)
- func (l *List[T]) AppendAll(vs []T)
- func (l *List[T]) At(i int) T
- func (l *List[T]) Clear()
- func (l *List[T]) Items() []T
- func (l *List[T]) Len() int
- func (l *List[T]) OnChange(fn func()) func()
- func (l *List[T]) Remove(i int)
- func (l *List[T]) Set(i int, v T)
- func (l *List[T]) SetItems(items []T)
- type Observable
- type Prop
- type Signal
- type VoidSignal
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
func NewCommand ¶
func (*Command) CanExecute ¶
func (*Command) OnCanExecuteChanged ¶
type ContextCommand ¶
type ContextCommand struct {
// contains filtered or unexported fields
}
func NewContextCommand ¶
func (*ContextCommand) CanExecute ¶
func (c *ContextCommand) CanExecute(ctx context.Context) bool
func (*ContextCommand) Execute ¶
func (c *ContextCommand) Execute(ctx context.Context)
func (*ContextCommand) OnCanExecuteChanged ¶
func (c *ContextCommand) OnCanExecuteChanged(fn func(canExec bool)) func()
func (*ContextCommand) Refresh ¶
func (c *ContextCommand) Refresh(ctx context.Context)
type EnumCommand ¶
type EnumCommand[T comparable] struct { // contains filtered or unexported fields }
func NewEnumCommand ¶
func NewEnumCommand[T comparable]() *EnumCommand[T]
func (*EnumCommand[T]) Execute ¶
func (c *EnumCommand[T]) Execute(val T)
func (*EnumCommand[T]) On ¶
func (c *EnumCommand[T]) On(val T) *Command
func (*EnumCommand[T]) Register ¶
func (c *EnumCommand[T]) Register(on T, cmd *Command) func()
type Observable ¶
type Observable[T any] interface { Get() T OnChange(func(T)) func() }
Observable is the read-only contract shared by Prop, CmpProp, and Derived values.
type Prop ¶
type Prop[T any] struct { // contains filtered or unexported fields }
func Derive ¶
func Derive[S any, T comparable](source Observable[S], fn func(S) T) (*Prop[T], func())
Derive creates a new Prop whose value is computed from a source Observable. The returned Prop updates whenever the source changes, deduplicating equal values. The second return value stops the derivation when called.
func NewProp ¶
func NewProp[T comparable](initial T) *Prop[T]
NewProp creates a Prop for comparable types, using == for equality.
func (*Prop[T]) OnValue ¶
func (p *Prop[T]) OnValue(wanted T, fn func()) func()
OnValue registers fn to be called whenever the value becomes equal to wanted.
type VoidSignal ¶
type VoidSignal struct {
// contains filtered or unexported fields
}
VoidSignal is a Signal that carries no value.
func NewVoidSignal ¶
func NewVoidSignal() *VoidSignal
func (*VoidSignal) Emit ¶
func (s *VoidSignal) Emit()
func (*VoidSignal) Subscribe ¶
func (s *VoidSignal) Subscribe(fn func()) func()
Click to show internal directories.
Click to hide internal directories.