reactive

package
v0.0.0-...-134e172 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type State

type State[T any] struct {
	// contains filtered or unexported fields
}

func NewState

func NewState[T any](initialValue T) *State[T]

func (*State[T]) Get

func (rs *State[T]) Get() T

func (*State[T]) GetTimestamp

func (rs *State[T]) GetTimestamp() time.Time

func (*State[T]) Subscribe

func (rs *State[T]) Subscribe(subscriber StateSubscriber[T])

func (*State[T]) Update

func (rs *State[T]) Update(value T)

type StateSubscriber

type StateSubscriber[T any] func(old, state *T)

Jump to

Keyboard shortcuts

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