ZipFromIterable Operator

March 22, 2021 ยท View on GitHub

Overview

Merge the emissions of an Iterable via a specified function and emit single items for each combination based on the results of this function.

Example

observable1 := rxgo.Just(1, 2, 3)()
observable2 := rxgo.Just(10, 20, 30)()
zipper := func(_ context.Context, i1 interface{}, i2 interface{}) (interface{}, error) {
	return i1.(int) + i2.(int), nil
}
zippedObservable := observable1.ZipFromIterable(observable2, zipper)

Output:

11
22
33

Options