ToSlice Operator

February 25, 2020 ยท View on GitHub

Overview

Transform the Observable items into a slice. It accepts a capacity that will be used as the initial capacity of the slice produced.

Example

s, err := rxgo.Just(1, 2, 3)().ToSlice(3)
if err != nil {
	return err
}
fmt.Println(s)

Output:

[1 2 3]

Options

  • WithContext

  • WithObservationStrategy

  • WithErrorStrategy

Contents

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