property

package
v0.0.0-...-9038b1f Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2020 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DidSet

type DidSet func(old, new interface{})

type Func

type Func struct {
	// contains filtered or unexported fields
}

type Int

type Int interface {
	// Set updates the property value and fires an event, if the new value is different than the old value.
	Set(v int)

	// Get returns the current property value
	Get() int

	// Bind connects the given pointer to a string with the value. The first time, the value from dst is read and
	// populates the property. Afterwards the direction is always the opposite, and updates to the property
	// will update the dst.
	Bind(dst *int)

	// Observe registers a callback which is fired, if the value has been set. It is not fire, if the value has not
	// been changed, e.g. if setting the same string.
	Observe(onDidSet func(old, new int)) Func
}

Int defines the contract for an int property.

func NewInt

func NewInt() Int

NewInt creates a new self-contained property.

type String

type String interface {
	// Set updates the property value and fires an event, if the new value is different than the old value.
	Set(v string)

	// Get returns the current property value
	Get() string

	// Bind connects the given pointer to a string with the value. The first time, the value from dst is read and
	// populates the property. Afterwards the direction is always the opposite, and updates to the property
	// will update the dst.
	Bind(dst *string)

	// Observe registers a callback which is fired, if the value has been set. It is not fire, if the value has not
	// been changed, e.g. if setting the same string.
	Observe(onDidSet func(old, new string)) Func
}

String defines the contract for a string property.

func NewString

func NewString() String

NewString creates a new self-contained property.

Jump to

Keyboard shortcuts

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