Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultEqual ¶ added in v0.12.1
func DefaultEqual[T comparable](new T, old T) bool
func NeverEqual ¶ added in v0.12.1
Types ¶
type Watcher ¶
type Watcher[T any] interface { // Cancel runs when the subscription ends, whether the context was canceled // or the returned cancel function was called. Cancel() // Watch receives the current value on the calling goroutine, then every // update. Return true to end the subscription. Watch(ctx context.Context, value T) bool }
Watcher is a subscriber to a value stream.
Click to show internal directories.
Click to hide internal directories.