Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Iterable ¶
type Iterable[T any] interface { Observe() <-chan T Subscribers() []chan T Unsub(<-chan T) }
type IterableImpl ¶
type IterableImpl[T any] struct { // contains filtered or unexported fields }
func (*IterableImpl[T]) Observe ¶
func (i *IterableImpl[T]) Observe() <-chan T
func (*IterableImpl[T]) Subscribers ¶
func (i *IterableImpl[T]) Subscribers() []chan T
func (*IterableImpl[T]) Unsub ¶
func (i *IterableImpl[T]) Unsub(ch <-chan T)
type Observable ¶
type Observable[T any] struct { // contains filtered or unexported fields }
func FromChannel ¶
func FromChannel[T any](ch <-chan T) Observable[T]
func (*Observable[T]) Subscribe ¶
func (o *Observable[T]) Subscribe(cb func(item T)) Subscription
func (*Observable[T]) UnsubscribeAll ¶
func (o *Observable[T]) UnsubscribeAll()
type Subscription ¶
type Subscription struct {
Unsubscribe func()
}
Click to show internal directories.
Click to hide internal directories.