Defer Operator

February 25, 2020 ยท View on GitHub

Overview

do not create the Observable until the observer subscribes, and create a fresh Observable for each observer.

Example

observable := rxgo.Defer([]rxgo.Producer{func(ctx context.Context, next chan<- rxgo.Item) {
	next <- rxgo.Of(1)
	next <- rxgo.Of(2)
	next <- rxgo.Of(3)
}})

Output:

1
2
3

Options

  • WithBufferedChannel

  • WithContext

  • WithObservationStrategy

  • WithErrorStrategy

Contents

  1. 1Overview
  2. 2Example
  3. 3Options