signals

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2026 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Continue    = false
	Unsubscribe = true
)

Variables

This section is empty.

Functions

func ContinueIf added in v1.3.0

func ContinueIf(condition bool) bool

Types

type Signal

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

func NewSignal

func NewSignal[T any]() Signal[T]

func (*Signal[T]) Notify

func (b *Signal[T]) Notify(args ...any)

func (*Signal[T]) On

func (b *Signal[T]) On(handler T) *Subscription

func (*Signal[T]) Unsubscribe

func (b *Signal[T]) Unsubscribe(sub *Subscription)

type StatefulSignal

type StatefulSignal[T any] struct {
	Signal[func(T) bool]
	// contains filtered or unexported fields
}

func NewStatefulSignal

func NewStatefulSignal[T any](initialValue T) *StatefulSignal[T]

func (*StatefulSignal[T]) CurrentValue

func (s *StatefulSignal[T]) CurrentValue() T

func (*StatefulSignal[T]) Notify

func (s *StatefulSignal[T]) Notify(callback func(oldValue T) T)

func (*StatefulSignal[T]) On

func (s *StatefulSignal[T]) On(handler func(T) bool) *Subscription

func (*StatefulSignal[T]) OnLazy

func (s *StatefulSignal[T]) OnLazy(handler func(T) bool) *Subscription

func (*StatefulSignal[T]) Set added in v1.3.0

func (s *StatefulSignal[T]) Set(value T)

type StatelessSignal

type StatelessSignal[T any] struct {
	Signal[func(T) bool]
}

func NewStatelessSignal

func NewStatelessSignal[T any]() *StatelessSignal[T]

func (*StatelessSignal[T]) Notify

func (s *StatelessSignal[T]) Notify(newValue T)

func (*StatelessSignal[T]) On

func (s *StatelessSignal[T]) On(handler func(T) bool) *Subscription

type Subscription

type Subscription uuid.UUID

Jump to

Keyboard shortcuts

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