observer

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bind added in v0.0.24

func Bind[T, V any](obs rx.Observer[T], fn func(rx.Observer[T]) V) rx.Observer[V]

func Filter added in v0.0.24

func Filter[T any](obs rx.Observer[T], predicate func(T) bool) rx.Observer[T]

func Lift

func Lift[F rx.AnonymousObserver[T], T any](fn F) rx.Observer[T]

func Lift2 added in v0.0.24

func Lift2[F rx.AnonymousObserver2[K, V], K, V any](fn F) rx.Observer2[K, V]

func Subscribe

func Subscribe[O rx.AnonymousObserver[T], T any](
	observable rx.Observable[T], fn O,
) rx.Subscription

func WithNext added in v0.0.24

func WithNext[T any](obs rx.Observer[T], next func(T)) rx.Observer[T]

Types

type Anonymous

type Anonymous[T any] struct {
	Complete func()
	Error    func(error)
	Next     func(T)
}

func (Anonymous[T]) OnComplete

func (a Anonymous[T]) OnComplete()

OnComplete implements rx.Observer.

func (Anonymous[T]) OnError

func (a Anonymous[T]) OnError(err error)

OnError implements rx.Observer.

func (Anonymous[T]) OnNext

func (a Anonymous[T]) OnNext(x T)

OnNext implements rx.Observer.

type Anonymous2 added in v0.0.24

type Anonymous2[K, V any] struct {
	Complete func()
	Error    func(error)
	Next     func(K, V)
}

func (Anonymous2[K, V]) OnComplete added in v0.0.24

func (a Anonymous2[K, V]) OnComplete()

OnComplete implements rx.Observer.

func (Anonymous2[K, V]) OnError added in v0.0.24

func (a Anonymous2[K, V]) OnError(err error)

OnError implements rx.Observer.

func (Anonymous2[K, V]) OnNext added in v0.0.24

func (a Anonymous2[K, V]) OnNext(k K, v V)

OnNext implements rx.Observer.

Jump to

Keyboard shortcuts

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