reactive

package
v0.0.0-...-0465bea Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommonVariable

type CommonVariable interface {
	Value() interface{}
	Name() string
	Prefix() string
	FullName() string
	Rename(string)
}

CommonVariable is base interface for all variables.

type Config

type Config struct {
	Name  string
	Debug bool
}

type Registry

type Registry interface {
	Float(name string) SyncVariable[float64]
	Bool(name string) SyncVariable[bool]
	String(name string) SyncVariable[string]
	Dump() map[string]interface{}
	GetAll() []CommonVariable
}

func New

func New(config Config) Registry

type SyncVariable

type SyncVariable[T comparable] interface {
	Variable[T]

	// Sync keep value sync with internal value.
	Sync(*T)
	Unsync(*T)
}

func NewSyncVariable

func NewSyncVariable[T comparable](name string) SyncVariable[T]

type Variable

type Variable[T comparable] interface {
	OnChange(func(T)) event.Subscriber
	Repeat()
	// contains filtered or unexported methods
}

func NewVariable

func NewVariable[T comparable](name string) Variable[T]

Jump to

Keyboard shortcuts

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